import "./components/ui/tidal.css"; import { useState, type MouseEvent } from "react"; import { TidalFooterTrust, type TidalFooterTrustLink, type TidalFooterTrustNavGroup, type TidalFooterTrustTopic } from "./components/ui/footer-trust"; import "./components/ui/footer-trust.css"; import "./components/ui/segmented-control.css"; import "./components/ui/status-badge.css"; function localLink(label: string, setStatus: (message: string) => void) { return (event: MouseEvent) => { if ( event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey ) { return; } event.preventDefault(); setStatus(`${label} selected in this preview.`); }; } export function FooterTrustDemo() { const [selectedTopicId, setSelectedTopicId] = useState("security"); const [status, setStatus] = useState("No preview action selected."); const topics: readonly TidalFooterTrustTopic[] = [ { id: "security", label: "Security", statusLabel: "Two documents supplied", evidence: [ { id: "overview", title: "Security overview", description: "Access, deployment and recovery practices.", href: "#preview-security-overview", linkProps: { onClick: localLink("Security overview", setStatus) }, }, { id: "access", title: "Access-control notes", description: "Roles and permissions across the product.", href: "#preview-access", linkProps: { onClick: localLink("Access-control notes", setStatus) }, }, ], }, { id: "privacy", label: "Privacy", statusLabel: "One document supplied", evidence: [ { id: "handling", title: "Data-handling summary", description: "Data collection, retention and deletion.", href: "#preview-data-handling", linkProps: { onClick: localLink("Data-handling summary", setStatus) }, }, ], }, { id: "review", label: "Review", statusLabel: "No documents supplied", status: "warning", evidence: [], }, ]; const actions: readonly TidalFooterTrustLink[] = [ { id: "portal", label: "Open trust documents", href: "#preview-trust-documents", onClick: localLink("Trust documents", setStatus), }, { id: "report", label: "Report a vulnerability", href: "#preview-report", onClick: localLink("Vulnerability report", setStatus), }, ]; const navigationGroups: readonly TidalFooterTrustNavGroup[] = [ { id: "policies", label: "Policies", links: [ { id: "privacy", label: "Privacy notice", href: "#preview-privacy", onClick: localLink("Privacy notice", setStatus), }, { id: "terms", label: "Terms", href: "#preview-terms", onClick: localLink("Terms", setStatus), }, ], }, ]; return ( Product trust } heading="Review our policies." description="Security, privacy and access documentation." topics={topics} selectedTopicId={selectedTopicId} onTopicChange={(id) => { setSelectedTopicId(id); setStatus(`${id} topic selected.`); }} actions={actions} navigationGroups={navigationGroups} legal={Sample documents. No certification is claimed.} status={{status}} /> ); } export default function AgentExample() { return (
); }