"use client"
import {
Example,
ExampleWrapper,
} from "@/registry/bases/base/components/example"
import { Button } from "@/registry/bases/base/ui/button"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/registry/bases/base/ui/dropdown-menu"
import { Input } from "@/registry/bases/base/ui/input"
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/registry/bases/base/ui/select"
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "@/registry/bases/base/ui/table"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"
const invoices = [
{
invoice: "INV001",
paymentStatus: "Paid",
totalAmount: "$250.00",
paymentMethod: "Credit Card",
},
{
invoice: "INV002",
paymentStatus: "Pending",
totalAmount: "$150.00",
paymentMethod: "PayPal",
},
{
invoice: "INV003",
paymentStatus: "Unpaid",
totalAmount: "$350.00",
paymentMethod: "Bank Transfer",
},
{
invoice: "INV004",
paymentStatus: "Paid",
totalAmount: "$450.00",
paymentMethod: "Credit Card",
},
{
invoice: "INV005",
paymentStatus: "Paid",
totalAmount: "$550.00",
paymentMethod: "PayPal",
},
{
invoice: "INV006",
paymentStatus: "Pending",
totalAmount: "$200.00",
paymentMethod: "Bank Transfer",
},
{
invoice: "INV007",
paymentStatus: "Unpaid",
totalAmount: "$300.00",
paymentMethod: "Credit Card",
},
]
export default function TableExample() {
return (
)
}
function TableBasic() {
return (
A list of your recent invoices.
Invoice
Status
Method
Amount
{invoices.slice(0, 3).map((invoice) => (
{invoice.invoice}
{invoice.paymentStatus}
{invoice.paymentMethod}
{invoice.totalAmount}
))}
)
}
function TableWithFooter() {
return (
A list of your recent invoices.
Invoice
Status
Method
Amount
{invoices.slice(0, 3).map((invoice) => (
{invoice.invoice}
{invoice.paymentStatus}
{invoice.paymentMethod}
{invoice.totalAmount}
))}
Total
$2,500.00
)
}
function TableSimple() {
return (
Name
Email
Role
Sarah Chen
sarah.chen@acme.com
Admin
Marc Rodriguez
marcus.rodriguez@acme.com
User
Emily Watson
emily.watson@acme.com
User
)
}
function TableWithBadges() {
return (
Task
Status
Priority
Design homepage
Completed
High
Implement API
In Progress
Medium
Write tests
Pending
Low
)
}
function TableWithActions() {
return (
Product
Price
Actions
Wireless Mouse
$29.99
}
>
Open menu
Edit
Duplicate
Delete
Mechanical Keyboard
$129.99
}
>
Open menu
Edit
Duplicate
Delete
USB-C Hub
$49.99
}
>
Open menu
Edit
Duplicate
Delete
)
}
const people = [
{ value: "sarah", label: "Sarah Chen" },
{ value: "marcus", label: "Marc Rodriguez" },
{ value: "emily", label: "Emily Watson" },
{ value: "david", label: "David Kim" },
]
const tasks = [
{
task: "Design homepage",
assignee: "sarah",
status: "In Progress",
},
{
task: "Implement API",
assignee: "marcus",
status: "Pending",
},
{
task: "Write tests",
assignee: "emily",
status: "Not Started",
},
]
function TableWithSelect() {
return (
Task
Assignee
Status
{tasks.map((item) => (
{item.task}
person.value === item.assignee
)}
itemToStringValue={(item) => {
return item.value
}}
>
{people.map((person) => (
{person.label}
))}
{item.status}
))}
)
}
function TableWithInput() {
return (
)
}