import { Table2 } from '@liam-hq/ui' import { Command } from 'cmdk' import type { FC } from 'react' import { useSchemaOrThrow } from '../../../../../../stores' import { getTableLinkHref } from '../../../../utils/url/getTableLinkHref' import type { CommandPaletteSuggestion } from '../types' import { getSuggestionText } from '../utils' import styles from './CommandPaletteOptions.module.css' import { useTableOptionSelect } from './hooks/useTableOptionSelect' type Props = { suggestion: CommandPaletteSuggestion | null } export const TableOptions: FC = ({ suggestion }) => { const schema = useSchemaOrThrow() const { optionSelectHandler } = useTableOptionSelect(suggestion) return ( {Object.values(schema.current.tables).map((table) => ( optionSelectHandler(event, table.name)} > {table.name} ))} ) }