import { Building2, CreditCard, DollarSign, Globe, Mail, Phone, User, } 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" import { Money } from "@/shared/components/money" type VendorData = { id?: number salutation?: string | null first_name?: string | null last_name?: string | null company_name?: string | null email?: string | null phone?: string | null alternate_phone?: string | null website?: string | null opening_balance?: number | string | null credit_limit?: number | string | null status?: string | null created_at?: string updated_at?: string } type VendorGeneralInfoProps = { vendor: VendorData } function InfoItem({ icon: Icon, label, value, }: { icon: React.ComponentType<{ className?: string }> label: string value?: React.ReactNode }) { const isEmpty = value == null || value === "" return (
{label} {isEmpty ? : value}
) } export function VendorGeneralInfo({ vendor }: VendorGeneralInfoProps) { const fullName = [vendor.salutation, vendor.first_name, vendor.last_name] .filter(Boolean) .join(" ") .trim() return (
Vendor Information
{vendor.company_name || fullName || "Unknown vendor"} {vendor.status && ( {vendor.status} )}
Contact Details Financial Details : null} /> : null} />
) }