import { PlantIcon } from './PlantIcon' import { cardActionClass, cardDangerClass } from '@/components/ui/cardActions' import { CATEGORY_LABELS, isBuiltin, type Plant } from '@/lib/plants' import { formatSpacing, type UnitPref } from '@/lib/units' /** * One catalog plant as a card: icon tile tinted with the plant's color, name, * category + mature spacing (unit-aware), and actions. Built-ins are badged and * offer only "Duplicate" (they're read-only); own plants add Edit/Delete. */ export function PlantCard({ plant, unit, onEdit, onDelete, onDuplicate, }: { plant: Plant unit: UnitPref onEdit: () => void onDelete: () => void onDuplicate: () => void }) { const builtin = isBuiltin(plant) return (

{plant.name}

{builtin && ( Built-in )}

{CATEGORY_LABELS[plant.category]} ยท {formatSpacing(plant.spacingCm, unit)} spacing

{plant.notes &&

{plant.notes}

}
{!builtin && ( )} {!builtin && ( )}
) }