mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## 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>
32 lines
1.1 KiB
TypeScript
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>
|
|
)
|
|
}
|