import { User, Mail, Phone, MapPin, Building2, Globe, DollarSign, CreditCard, Tag, Users, FileText, } from "lucide-react" import { Card, CardContent, CardHeader, CardTitle, } from "@/shared/components/ui/card" import { Badge } from "@/shared/components/ui/badge" import { Separator } from "@/shared/components/ui/separator" type CustomerData = { id?: number customer_type_id?: number salutation?: string first_name?: string last_name?: string company_name?: string email?: string phone?: string alternate_phone?: string opening_balance?: number credit_limit?: number website?: string referral_source_id?: number payment_terms_id?: number address_line_1?: string address_line_2?: string country_id?: number state_id?: number city?: string zip_code?: string created_at?: string updated_at?: string customer_type?: { id?: number; name?: string } referral_source?: { id?: number; title?: string } payment_terms?: { id?: number; title?: string } country?: { id?: number; name?: string } state?: { id?: number; name?: string } } type CustomerGeneralInfoProps = { customer: CustomerData } function InfoItem({ icon: Icon, label, value, }: { icon: React.ComponentType<{ className?: string }> label: string value?: string | number | null }) { return (
{label} {value != null && value !== "" ? ( String(value) ) : ( )}
) } export function CustomerGeneralInfo({ customer }: CustomerGeneralInfoProps) { const fullName = [customer.salutation, customer.first_name, customer.last_name] .filter(Boolean) .join(" ") return (
{/* Personal Info */} Personal Information
{fullName || "Unknown"} {customer.customer_type?.name && ( {customer.customer_type.name} )}
{/* Contact Info */} Contact Details {/* Address */} Address {/* Financial Info */} Financial Details
) }