"use client"; import { Card, CardContent, CardHeader, CardFooter } from "@/components/ui/card"; import { Sprout, Calendar, ArrowRight, BarChart } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Progress } from "@/components/ui/progress"; import type { Crop } from "@/types"; interface CropCardProps { crop: Crop; onClick?: () => void; } export function CropCard({ crop, onClick }: CropCardProps) { const statusColors = { growing: { bg: "bg-green-50 dark:bg-green-900", text: "text-green-600 dark:text-green-300", border: "border-green-200", }, harvested: { bg: "bg-yellow-50 dark:bg-yellow-900", text: "text-yellow-600 dark:text-yellow-300", border: "border-yellow-200", }, planned: { bg: "bg-blue-50 dark:bg-blue-900", text: "text-blue-600 dark:text-blue-300", border: "border-blue-200", }, }; const statusColor = statusColors[crop.status as keyof typeof statusColors]; return (
{crop.status}
{crop.plantedDate.toLocaleDateString()}

{crop.name}

{crop.variety} • {crop.area}

{crop.status !== "planned" && (
Progress {crop.progress}%
)} {crop.status === "growing" && (
Health: {crop.healthScore}%
)}
); }