aboutsummaryrefslogtreecommitdiff
path: root/src/modules/command-palette/command-palette.store.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/command-palette/command-palette.store.ts')
-rw-r--r--src/modules/command-palette/command-palette.store.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/command-palette/command-palette.store.ts b/src/modules/command-palette/command-palette.store.ts
index f215388..9637f95 100644
--- a/src/modules/command-palette/command-palette.store.ts
+++ b/src/modules/command-palette/command-palette.store.ts
@@ -8,10 +8,12 @@ import { useStyleStore } from '@/stores/style.store';
import SunIcon from '~icons/mdi/white-balance-sunny';
import GithubIcon from '~icons/mdi/github';
import BugIcon from '~icons/mdi/bug-outline';
+import DiceIcon from '~icons/mdi/dice-5';
export const useCommandPaletteStore = defineStore('command-palette', () => {
const toolStore = useToolStore();
const styleStore = useStyleStore();
+ const router = useRouter();
const searchPrompt = ref('');
const toolsOptions = toolStore.tools.map(tool => ({
@@ -24,6 +26,18 @@ export const useCommandPaletteStore = defineStore('command-palette', () => {
const searchOptions: PaletteOption[] = [
...toolsOptions,
{
+ name: 'Random tool',
+ description: 'Get a random tool from the list.',
+ action: () => {
+ const { path } = _.sample(toolStore.tools)!;
+ router.push(path);
+ },
+ icon: DiceIcon,
+ category: 'Tools',
+ keywords: ['random', 'tool', 'pick', 'choose', 'select'],
+ closeOnSelect: true,
+ },
+ {
name: 'Toggle dark mode',
description: 'Toggle dark mode on or off.',
action: () => styleStore.toggleDark(),