examples/table-sortable.tsx
1"use client";23import * as React from "react";4import {5 Table,6 TableBody,7 TableCell,8 TableHead,9 TableHeader,10 TableRow,11} from "@/components/wensity/table";1213export function SortableTable() {14 const [direction, setDirection] = React.useState<"asc" | "desc">("asc");1516 return (17 <Table>18 <TableHeader>19 <TableRow>20 <TableHead21 sortable22 sortDirection={direction}23 onSort={() => setDirection((d) => (d === "asc" ? "desc" : "asc"))}24 >25 Customer26 </TableHead>27 <TableHead>Status</TableHead>28 </TableRow>29 </TableHeader>30 <TableBody>31 <TableRow>32 <TableCell>Northwind Labs</TableCell>33 <TableCell>Paid</TableCell>34 </TableRow>35 </TableBody>36 </Table>37 );38}