import "./components/ui/tidal.css"; import { useState, type MouseEvent } from "react"; import { TidalFooterLocations, type TidalFooterLocationsNavGroup, type TidalFooterLocationOffice } from "./components/ui/footer-locations"; import "./components/ui/footer-locations.css"; const tidalExampleStyles = ".tidal-scope .footer-pilot-05-demo,\n.tidal-scope .footer-pilot-05-demo-shell {\n min-inline-size: 0;\n inline-size: 100%;\n}"; const offices: readonly TidalFooterLocationOffice[] = [ { id: "chicago", city: "Chicago", timezone: "Central Time", timeReference: "10:00–18:00 · Sample hours", address: "100 Example Avenue, Chicago", addressHref: "#preview-chicago-office", mapX: 26, mapY: 34, }, { id: "lisbon", city: "Lisbon", timezone: "Western European Time", timeReference: "09:00–17:00 · Sample hours", address: "20 Example Square, Lisbon", addressHref: "#preview-lisbon-office", mapX: 64, mapY: 23, }, { id: "singapore", city: "Singapore", timezone: "Singapore Time", timeReference: "09:30–18:30 · Sample hours", address: "30 Example Street, Singapore", addressHref: "#preview-singapore-office", mapX: 82, mapY: 44, }, ]; const navigationGroups: readonly TidalFooterLocationsNavGroup[] = [ { id: "visit", label: "Visit", links: [ { id: "offices", label: "Office locations", href: "#preview-offices" }, { id: "access", label: "Accessibility", href: "#preview-accessibility" }, ], }, { id: "learn", label: "Learn", links: [ { id: "docs", label: "Documentation", href: "#preview-docs" }, { id: "support", label: "Support", href: "#preview-support" }, ], }, ]; function handlePreviewClick( label: string, setStatus: (status: string) => void, ) { return (event: MouseEvent) => { if ( event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.currentTarget.target ) { return; } event.preventDefault(); setStatus(`${label} selected in this local preview.`); }; } export function FooterLocationsDemo() { const [activeOfficeId, setActiveOfficeId] = useState( "chicago", ); const [status, setStatus] = useState("No preview destination selected."); const previewOffices = offices.map((office) => ({ ...office, addressLinkProps: { ...office.addressLinkProps, onClick: handlePreviewClick(String(office.city), setStatus), }, })); const previewNavigationGroups = navigationGroups.map((group) => ({ ...group, links: group.links.map((link) => ({ ...link, onClick: handlePreviewClick(String(link.label), setStatus), })), })); return (
TidalUI } heading="Our offices." description="Select a sample location to view its details." offices={previewOffices} navigationGroups={previewNavigationGroups} activeOfficeId={activeOfficeId} onOfficeChange={(officeId) => { setActiveOfficeId(officeId); setStatus(`${officeId} selected in this local preview.`); }} legal={Fictional offices and sample hours.} status={{status}} />
); } export default function AgentExample() { return (
); }