import { FC } from 'react' import { Button, Typography } from '@supabase/ui' import { PostgresTable } from '@supabase/postgres-meta' import { useStore } from 'hooks' interface Props { selectedSchema: string onAddTable: () => void } const EmptyState: FC = ({ selectedSchema, onAddTable }) => { const { meta } = useStore() const tables = meta.tables.list((table: PostgresTable) => table.schema === selectedSchema) const renderNoTablesCTA = () => { return (
There are no tables available in this schema {selectedSchema === 'public' && }
) } return (
{tables.length === 0 ? ( renderNoTablesCTA() ) : (
Select a table or create a new one
)}
) } export default EmptyState