import { Card, CardContent } from '@/components/ui/card'; import { Progress } from '@/components/ui/progress'; import { Zap, Check, Circle, Camera, FileText, MapPin, Phone, Clock, } from 'lucide-react'; import { cn } from '@/lib/utils'; interface ShopBountyCardProps { // Current form state to calculate potential reward hasName: boolean; hasAddress: boolean; hasCoordinates: boolean; hasDescription: boolean; hasPhone: boolean; hasWebsite: boolean; hasHours: boolean; photoCount: number; } interface QualityCheckItem { id: string; label: string; points: number; completed: boolean; icon: React.ComponentType<{ className?: string }>; } export function ShopBountyCard({ hasName, hasAddress, hasCoordinates, hasDescription, hasPhone, hasWebsite, hasHours, photoCount, }: ShopBountyCardProps) { const checks: QualityCheckItem[] = [ { id: 'name', label: 'Shop name', points: 15, completed: hasName, icon: MapPin, }, { id: 'location', label: 'Address & coordinates', points: 20, completed: hasAddress && hasCoordinates, icon: MapPin, }, { id: 'photo1', label: 'At least 1 photo', points: 15, completed: photoCount >= 1, icon: Camera, }, { id: 'photo3', label: '3+ photos', points: 10, completed: photoCount >= 3, icon: Camera, }, { id: 'description', label: 'Description', points: 15, completed: hasDescription, icon: FileText, }, { id: 'contact', label: 'Contact info', points: 10, completed: hasPhone || hasWebsite, icon: Phone, }, { id: 'hours', label: 'Opening hours', points: 15, completed: hasHours, icon: Clock, }, ]; const completedChecks = checks.filter(c => c.completed); const score = completedChecks.reduce((sum, c) => sum + c.points, 0); const maxScore = checks.reduce((sum, c) => sum + c.points, 0); const percentage = Math.round((score / maxScore) * 100); const getScoreColor = () => { if (percentage >= 80) return 'text-green-400'; if (percentage >= 50) return 'text-[#ccff00]'; if (percentage >= 30) return 'text-yellow-400'; return 'text-orange-400'; }; const getProgressColor = () => { if (percentage >= 80) return 'bg-green-500'; if (percentage >= 50) return 'bg-[#ccff00]'; if (percentage >= 30) return 'bg-yellow-500'; return 'bg-orange-500'; }; const getScoreLabel = () => { if (percentage >= 80) return 'Excellent!'; if (percentage >= 50) return 'Good'; if (percentage >= 30) return 'Basic'; return 'Getting started'; }; return (
Earning Potential
{getScoreLabel()} {percentage}%
{/* Progress Bar */}
{/* Checklist */}
{checks.map((check) => { const Icon = check.icon; return (
{check.completed ? ( ) : ( )}
{check.label} +{check.points}%
); })}
{/* Tip */}

💡 Higher quality = More zaps from the community!

); }