import { Slot } from "@radix-ui/react-slot"; import { PropsWithChildren, ReactElement } from "react"; import { cn } from "../hooks"; export type LayoutType = "label-left" | "label-top"; export interface FormLayoutProps extends PropsWithChildren { align?: "start" | "center" | "end" | "baseline"; asChild?: boolean; className?: string; orientation?: LayoutType; children: [ReactElement, ReactElement]; } /** * Convenience layout wrapper for demos and description/content pairs. */ export function FormLayout({ asChild, className, align = "center", orientation = "label-top", children, }: FormLayoutProps) { const Com = asChild ? Slot : "div"; return ( {children} ); }