All files / src/components/admin ProInfoCard.tsx

100% Statements 1/1
100% Branches 8/8
100% Functions 1/1
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106                                                                                              103x                                                                                                                    
import type { Pro } from "../../lib/api";
import type {
	BusinessType,
	CustomerSegment,
	ServiceCategory,
	MaterialTag,
	Brand,
	City,
	Locality,
} from "../../lib/api/taxonomy";
import {
	BasicInformationSection,
	BusinessTypeSection,
	BusinessDetailsSection,
	RushOrdersSection,
	ServicesExpertiseSection,
	BrandsSection,
	LocationSection,
	ContactDetailsSection,
	SeoSettingsSection,
} from "./pro-form-sections";
 
interface ProInfoCardProps {
	pro: Pro;
	onUpdateField: (field: keyof Pro, value: unknown) => void;
	businessTypes?: BusinessType[];
	customerSegments?: CustomerSegment[];
	serviceCategories?: ServiceCategory[];
	materialTags?: Record<string, MaterialTag[]>;
	brands?: Record<string, Brand[]>;
	cities?: City[];
	localities?: Locality[];
	isLoadingTaxonomy?: boolean;
}
 
export function ProInfoCard({
	pro,
	onUpdateField,
	businessTypes = [],
	customerSegments = [],
	serviceCategories = [],
	materialTags = {},
	brands = {},
	cities = [],
	localities = [],
	isLoadingTaxonomy = false,
}: ProInfoCardProps) {
	return (
		<div className="space-y-6 lg:col-span-2">
			{/* Basic Information */}
			<BasicInformationSection pro={pro} onUpdateField={onUpdateField} />
 
			{/* Business Type */}
			<BusinessTypeSection
				pro={pro}
				onUpdateField={onUpdateField}
				businessTypes={businessTypes}
				isLoadingTaxonomy={isLoadingTaxonomy}
			/>
 
			{/* Business Details */}
			<BusinessDetailsSection
				pro={pro}
				onUpdateField={onUpdateField}
				customerSegments={customerSegments}
				isLoadingTaxonomy={isLoadingTaxonomy}
			/>
 
			{/* Rush Orders */}
			<RushOrdersSection pro={pro} onUpdateField={onUpdateField} />
 
			{/* Services & Expertise */}
			<ServicesExpertiseSection
				pro={pro}
				onUpdateField={onUpdateField}
				serviceCategories={serviceCategories}
				materialTags={materialTags}
				isLoadingTaxonomy={isLoadingTaxonomy}
			/>
 
			{/* Brands */}
			<BrandsSection
				pro={pro}
				onUpdateField={onUpdateField}
				brands={brands}
				isLoadingTaxonomy={isLoadingTaxonomy}
			/>
 
			{/* Location */}
			<LocationSection
				pro={pro}
				onUpdateField={onUpdateField}
				cities={cities}
				localities={localities}
				isLoadingTaxonomy={isLoadingTaxonomy}
			/>
 
			{/* Contact Details */}
			<ContactDetailsSection pro={pro} onUpdateField={onUpdateField} />
 
			{/* SEO Settings */}
			<SeoSettingsSection pro={pro} onUpdateField={onUpdateField} />
		</div>
	);
}