2024-05-08 09:57:16 -04:00
|
|
|
import usePlatform from 'hooks/usePlatform'
|
2024-08-23 16:20:22 -04:00
|
|
|
import { hotkeyDisplay } from 'lib/hotkeyWrapper'
|
|
|
|
import { COMMAND_PALETTE_HOTKEY } from './CommandBar/CommandBar'
|
2025-01-23 10:25:21 -05:00
|
|
|
import { commandBarActor } from 'machines/commandBarMachine'
|
2024-05-08 09:57:16 -04:00
|
|
|
|
|
|
|
export function CommandBarOpenButton() {
|
|
|
|
const platform = usePlatform()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<button
|
|
|
|
className="group rounded-full flex items-center justify-center gap-2 px-2 py-1 bg-primary/10 dark:bg-chalkboard-90 dark:backdrop-blur-sm border-primary hover:border-primary dark:border-chalkboard-50 dark:hover:border-inherit text-primary dark:text-inherit"
|
2025-01-23 10:25:21 -05:00
|
|
|
onClick={() => commandBarActor.send({ type: 'Open' })}
|
2024-09-10 12:10:14 +10:00
|
|
|
data-testid="command-bar-open-button"
|
2024-05-08 09:57:16 -04:00
|
|
|
>
|
|
|
|
<span>Commands</span>
|
|
|
|
<kbd className="bg-primary/10 dark:bg-chalkboard-80 dark:group-hover:bg-primary font-mono rounded-sm dark:text-inherit inline-block px-1 border-primary dark:border-chalkboard-90">
|
2024-08-23 16:20:22 -04:00
|
|
|
{hotkeyDisplay(COMMAND_PALETTE_HOTKEY, platform)}
|
2024-05-08 09:57:16 -04:00
|
|
|
</kbd>
|
|
|
|
</button>
|
|
|
|
)
|
|
|
|
}
|