import { ShareButton } from "@agent-native/core/client/sharing"; import { VisibilityBadge } from "@agent-native/toolkit/sharing"; import { IconPalette, IconStar, IconStarFilled } from "@tabler/icons-react"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; import type { DesignSystemData } from "../../../shared/api"; interface DesignSystemCardProps { id: string; title: string; data: DesignSystemData; isDefault: boolean; visibility?: "private" | "org" | "public" | null; onClick: () => void; onSetDefault: () => void; } function firstFontName(stack: string): string { return (stack.split(",")[0] ?? stack).replace(/['"]/g, "").trim(); } export function DesignSystemCard({ id, title, data, isDefault, visibility, onClick, onSetDefault, }: DesignSystemCardProps) { const swatchColors = [ { label: "Primary", color: data.colors.primary }, { label: "Secondary", color: data.colors.secondary }, { label: "Accent", color: data.colors.accent }, { label: "Background", color: data.colors.background }, { label: "Text", color: data.colors.text }, ]; const headingFamily = firstFontName(data.typography.headingFont); const bodyFamily = firstFontName(data.typography.bodyFont); return (
{/* Preview area */}
{/* Color swatches */}
{swatchColors.map((s) => (
))}
{/* Action overlay (top-right of preview) */}
e.stopPropagation()} > {isDefault ? "Default design system" : "Set as default"}
{/* Typography preview */}
Heading
Body text in {bodyFamily}
{/* Info area */}

{title}

{isDefault && ( Default )}
{headingFamily} {headingFamily !== bodyFamily && ` ยท ${bodyFamily}`}
); }