import { cn } from "~/utils/cn"; import { Paragraph } from "./Paragraph"; import { ArrowTopRightOnSquareIcon } from "@heroicons/react/20/solid"; import { SimpleTooltip } from "./Tooltip"; import { Link } from "@remix-run/react"; const variations = { primary: { label: "extra-small/bright", value: "extra-small", }, secondary: { label: "extra-extra-small/caps", value: "extra-small/bright", }, } as const; type LabelValueStackProps = { label: React.ReactNode; value: React.ReactNode; href?: string; layout?: "horizontal" | "vertical"; variant?: keyof typeof variations; className?: string; }; export function LabelValueStack({ label, value, href, layout = "vertical", variant = "secondary", className, }: LabelValueStackProps) { const variation = variations[variant]; return (
{label} <> {href ? ( ) : ( {value} )}
); } type ValueButtonStackProps = { value: React.ReactNode; href: string; variant?: keyof typeof variations; }; function ValueButton({ value, href, variant = "secondary" }: ValueButtonStackProps) { const variation = variations[variant]; const isExternalUrl = href.startsWith("http"); if (!isExternalUrl) { return ( {value} ); } return ( {value} } content={href} /> ); }