import { Copy, Eye, EyeOff, KeyRound, PanelTop, RectangleHorizontal, Scan, TidyUpIcon, } from '@liam-hq/ui' import { Command } from 'cmdk' import type { FC } from 'react' import { useUserEditingOrThrow } from '../../../../../../stores' import { useTableVisibility } from '../../hooks' import { useCommandPaletteOrThrow } from '../CommandPaletteProvider' import { useCopyLink } from '../hooks/useCopyLink' import { useFitScreen } from '../hooks/useFitScreen' import { getSuggestionText } from '../utils' import styles from './CommandPaletteOptions.module.css' export const CommandPaletteCommandOptions: FC = () => { const { copyLink } = useCopyLink('command-palette') const { zoomToFit, tidyUp } = useFitScreen() const { setShowMode } = useUserEditingOrThrow() const { visibilityStatus, showAllNodes, hideAllNodes } = useTableVisibility() const { setOpen } = useCommandPaletteOrThrow() return ( { copyLink() setOpen(false) }} > Copy Link C { zoomToFit() setOpen(false) }} className={styles.item} > Zoom to Fit 1 { tidyUp() setOpen(false) }} className={styles.item} > {/* The option has explicit text description, so that the icon does not have to have an aria-label */} Tidy Up T { setShowMode('ALL_FIELDS') setOpen(false) }} className={styles.item} > Show All Fields 2 { setShowMode('TABLE_NAME') setOpen(false) }} className={styles.item} > Show Table Name 3 { setShowMode('KEY_ONLY') setOpen(false) }} className={styles.item} > Show Key Only 4 {visibilityStatus !== 'all-visible' && ( { showAllNodes() setOpen(false) }} > Show All Tables A )} {visibilityStatus !== 'all-hidden' && ( { hideAllNodes() setOpen(false) }} > Hide All Tables H )} ) }