import "./components/ui/tidal.css"; import { useState } from "react"; import { TidalPivotTable, type TidalPivotRow, type TidalPivotSelection } from "./components/ui/pivot-table"; import "./components/ui/pivot-table.css"; export const pivotColumns = [ { id: "q1", label: "Q1" }, { id: "q2", label: "Q2" }, { id: "q3", label: "Q3" }, ]; export const pivotRows: readonly TidalPivotRow[] = [ { id: "north", label: "North America", values: { q1: 64000, q2: 82000, q3: 96000 }, total: 242000, }, { id: "us", label: "United States", parentId: "north", values: { q1: 48000, q2: 60000, q3: 70000 }, total: 178000, }, { id: "ca", label: "Canada", parentId: "north", values: { q1: 16000, q2: 22000, q3: 26000 }, total: 64000, }, { id: "eu", label: "Europe", values: { q1: 38000, q2: 46000, q3: 59000 }, total: 143000, }, { id: "uk", label: "United Kingdom", parentId: "eu", values: { q1: 22000, q2: 27000, q3: 35000 }, total: 84000, }, { id: "de", label: "Germany", parentId: "eu", values: { q1: 16000, q2: 19000, q3: 24000 }, total: 59000, }, ]; export function PivotTableDemo() { const [expanded, setExpanded] = useState(["north"]); const [selected, setSelected] = useState({ rowId: "north", columnId: "q3", }); return ( new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0, }).format(v) } /> ); } export default function AgentExample() { return (
); }