Files
supabase/packages/ui-patterns/CommandMenu/internal/Command.tsx
Charis 4fbcd61e95 feat: new command menu pt 1 (#23699)
Introduces the first (very small) slice of the new command menu as a `ui-pattern`.

This slice just handles state for available commands. It isn't hooked up to anything yet.
2024-06-04 14:32:13 -04:00

36 lines
645 B
TypeScript

import { type ReactNode } from 'react'
type ICommand = IActionCommand | IRouteCommand
interface IBaseCommand {
id: string
name: string
value?: string
className?: string
forceMount?: boolean
badge?: () => ReactNode
icon?: () => ReactNode
/**
* Whether the item should be hidden until searched
*/
defaultHidden?: boolean
/**
* Curerntly unused
*/
keywords?: string[]
/**
* Currently unused
*/
shortcut?: string
}
interface IActionCommand extends IBaseCommand {
action: () => void
}
interface IRouteCommand extends IBaseCommand {
route: `/${string}` | `http${string}`
}
export type { ICommand }