Files
supabase/apps/design-system/registry/default/example/empty-state-initial-state-informational.tsx
Gildas GarciaandIvan Vasilov 96d43099bb chore: refactor Button API so that it can be used a standard button (#46880)
## Problem

Our `<Button>` component breaks the default `button` contract by
redefining the `type` prop to set its variant (`primary`, `default`,
etc) instead of the button type (`submit`, `button`, etc).
This is confusing and forces to write more code when using it with
shadcn components that expect/inject the standard button props.

## Solution

- rename the `type` prop to `variant`
- rename the `htmlType` prop to `type`
- propagate the changes where necessary
- format code

## How to test

As this is just prop renaming, if it builds it's ok

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-06-16 23:59:58 +02:00

32 lines
1.1 KiB
TypeScript

import { Plus } from 'lucide-react'
import { Button, Card, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from 'ui'
export default function EmptyStateZeroItemsTable() {
return (
<div className="flex flex-col gap-y-4 w-full">
<Button className="w-fit self-end" variant="primary" size="tiny" icon={<Plus size={14} />}>
New table
</Button>
<Card>
<Table>
<TableHeader>
<TableRow>
<TableHead className="text-foreground-muted">Table name</TableHead>
<TableHead className="text-foreground-muted">Date created</TableHead>
<TableHead />
</TableRow>
</TableHeader>
<TableBody>
<TableRow className="[&>td]:hover:bg-inherit">
<TableCell colSpan={3}>
<p className="text-sm text-foreground">No tables yet</p>
<p className="text-sm text-foreground-lighter">Create a table to get started</p>
</TableCell>
</TableRow>
</TableBody>
</Table>
</Card>
</div>
)
}