import React from "react"; import { RadioGroup } from "./radio-group"; import { SelectableCard } from "./selectable-card"; import { cn } from "@/lib/utils"; /** * A single choice within a {@link SelectionCards} grid — an icon over a title. * Used for binary or small-set decisions (e.g. "New User" vs "Existing User", * "Individual" vs "Joint Application"). */ export interface SelectionCardOption { /** Stable key — becomes the RadioGroup value passed to onSelect. */ key: string; /** Card title. */ title: string; /** Icon rendered above the title — typically a lucide icon at a large size. */ icon: React.ReactNode; } export interface SelectionCardsProps { /** Heading shown above the option grid. */ title: string; options: SelectionCardOption[]; onSelect: (key: string) => void; /** Grid columns at the `md:` breakpoint and above. Defaults to 2. */ columns?: 2 | 3; className?: string; } /** * Composes {@link SelectableCard} + {@link RadioGroup} into the icon+title * choice grid used for the loan application entry decisions (getting-started, * select-application-type). */ export function SelectionCards({ title, options, onSelect, columns = 2, className, }: SelectionCardsProps) { return (