"use client"; /** * Product Select Field * * COPIED VERBATIM FROM: components/onboarding/steps/product-selection-step.tsx:47-80 * Renders product category cards with subcategory badges */ import { ANIMATION_CLASSES, getStaggerStyle, STAGGER_PRESETS, } from "../animations"; import { cx } from "../lib/utils"; import { OnboardingBadge } from "../primitives/onboarding-badge"; import { OnboardingCard } from "../primitives/onboarding-card"; import { OnboardingCheckbox } from "../primitives/onboarding-checkbox"; import { OnboardingLabel } from "../primitives/onboarding-label"; import type { ProductCategory, ProductSelectFieldProps } from "../types/fields"; interface CategoryItemProps { category: ProductCategory; checked: boolean; onCheckedChange: (categoryId: string, checked: boolean) => void; } /** * COPIED VERBATIM FROM: components/onboarding/steps/product-selection-step.tsx:47-80 */ function CategoryItem({ category, checked, onCheckedChange, }: CategoryItemProps) { return (
onCheckedChange(category.id, isChecked === true) } /> {category.title}
{category.subcategories.length > 0 && ( )}
); } export function ProductSelectField({ categories, selectedIds, onChange, ariaLabel, disabled = false, }: ProductSelectFieldProps) { const handleCheckedChange = (categoryId: string, isChecked: boolean) => { const newSelectedIds = isChecked ? [...selectedIds, categoryId] : selectedIds.filter((id) => id !== categoryId); onChange(newSelectedIds); }; return (
{ariaLabel}
{categories.map((category, index) => (
))}
); }