"use client"; import { Card, CardContent, CardHeader, CardFooter } from "@/components/ui/card"; import { MapPin, Sprout, Plus, CalendarDays, ArrowRight } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import type { Farm } from "@/types"; export interface FarmCardProps { variant: "farm" | "add"; farm?: Farm; onClick?: () => void; } export function FarmCard({ variant, farm, onClick }: FarmCardProps) { const cardClasses = cn( "w-full h-full overflow-hidden transition-all duration-200 hover:shadow-lg border", variant === "add" ? "bg-green-50/50 dark:bg-green-900/50 hover:bg-green-50/80 dark:hover:bg-green-900/80 border-dashed border-muted/60" : "bg-white dark:bg-slate-800 hover:bg-muted/10 dark:hover:bg-slate-700 border-muted/60" ); if (variant === "add") { return ( Add New Farm Create a new farm to manage your crops and resources ); } if (variant === "farm" && farm) { const formattedDate = new Intl.DateTimeFormat("en-US", { year: "numeric", month: "short", day: "numeric", }).format(farm.createdAt); return ( {farm.type} {formattedDate} {farm.name} {farm.location} Area {farm.area} Crops {farm.crops} View details ); } return null; }
Create a new farm to manage your crops and resources
Area
{farm.area}
Crops
{farm.crops}