mirror of
https://github.com/supabase/supabase.git
synced 2026-07-06 15:44:23 +08:00
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.
36 lines
645 B
TypeScript
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 }
|