import { type ComponentPropsWithRef, type FC, type PropsWithChildren, type ReactNode, } from "react"; import { Card } from "../Card/Card"; import clsx from "clsx"; import { type AsChildProps, Slot } from "../Slot.tsx"; import { IconPlusLarge } from "../Icons"; export function DataTable({ children, className, columns, }: PropsWithChildren<{ className?: string; columns: number | string[] }>) { const style = () => { if (typeof columns === "number") { return { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, }; } return { gridTemplateColumns: columns.join(" "), }; }; return (
{children}
); } export function CellHead({ children, className, ...props }: ComponentPropsWithRef<"div">) { return (
{children}
); } export function Row(props: ComponentPropsWithRef<"div">) { return
; } export function Cell({ asChild, ...props }: AsChildProps>) { const Component = asChild ? Slot : "div"; return ( ); } export function RowButton({ icon = IconPlusLarge, children, ...props }: { children: ReactNode; icon?: FC<{ size: number; className?: string }>; } & ComponentPropsWithRef<"button">) { const IconComponent = icon; return ( ); }