import React from "react"; import { cx } from "@/cva.config"; interface Props { label: string | React.ReactNode; id?: string; as?: "label" | "span"; description?: string | React.ReactNode | null; disabled?: boolean; } export default function FieldLabel({ label, id, as = "label", description, disabled, }: Props) { if (as === "label") { return ( ); } else if (as === "span") { return (
{label} {description && ( {description} )}
); } else { return <>; } }