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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | 178x 1x 4x 280x 7x 4x 890x 1x | import { CollapsibleCard } from "../../ui/collapsible";
import { Input } from "../../ui/input";
import { MultiSelect } from "../../ui/multi-select";
import { TagInput } from "../../ui/tag-input";
import type { ProFormSectionProps } from "./types";
import { LANGUAGES, TEAM_SIZES, TIMELINE_SUGGESTIONS } from "./constants";
import { Package } from "lucide-react";
/**
* BusinessDetailsSection component displays additional business information fields.
* Includes timeline capabilities, pricing tier, years in business, team size, and languages spoken.
*/
export function BusinessDetailsSection({
pro,
onUpdateField,
customerSegments = [],
isLoadingTaxonomy = false,
}: ProFormSectionProps) {
return (
<CollapsibleCard
title="Business Details"
description="Additional information about the business"
icon={<Package className="h-5 w-5" />}
defaultOpen={!!pro.customerSegmentId || !!pro.yearsInBusiness}
>
<div className="space-y-4 pt-4">
<div className="space-y-2">
<label
htmlFor="admin-timeline-capabilities"
className="text-sm font-medium text-foreground-default"
>
Timeline Capabilities
</label>
<p className="text-xs text-foreground-muted">
Typical project timelines. Type custom values or click suggestions.
</p>
<TagInput
id="admin-timeline-capabilities"
values={pro.timelineCapabilities || []}
onChange={(values) =>
onUpdateField(
"timelineCapabilities",
values.length > 0 ? values : null,
)
}
suggestions={[...TIMELINE_SUGGESTIONS]}
placeholder="e.g., 2-3 weeks for modular kitchen..."
/>
</div>
<div className="space-y-2">
<label
htmlFor="admin-customer-segment"
className="text-sm font-medium text-foreground-default"
>
Pricing Tier
</label>
{isLoadingTaxonomy ? (
<div className="animate-pulse h-10 bg-background-subtle rounded" />
) : (
<select
id="admin-customer-segment"
value={pro.customerSegmentId || ""}
onChange={(e) =>
onUpdateField("customerSegmentId", e.target.value || null)
}
className="flex h-10 w-full rounded-md border border-border-default bg-background-elevated px-3 py-2 text-sm text-foreground-default focus:outline-none focus:ring-2 focus:ring-primary-500/40 focus:border-primary-500"
>
<option value="">Select pricing tier</option>
{customerSegments.map((seg) => (
<option key={seg.id} value={seg.id}>
{seg.name} {seg.priceIndicator && `(${seg.priceIndicator})`}
</option>
))}
</select>
)}
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<div className="space-y-2">
<label
htmlFor="admin-years-in-business"
className="text-sm font-medium text-foreground-default"
>
Years in Business
</label>
<Input
id="admin-years-in-business"
type="number"
value={pro.yearsInBusiness?.toString() || ""}
onChange={(e) =>
onUpdateField(
"yearsInBusiness",
e.target.value ? parseInt(e.target.value, 10) : null,
)
}
placeholder="e.g., 5"
min="0"
/>
</div>
<div className="space-y-2">
<label
htmlFor="admin-team-size"
className="text-sm font-medium text-foreground-default"
>
Team Size
</label>
<select
id="admin-team-size"
value={pro.teamSize || ""}
onChange={(e) =>
onUpdateField("teamSize", e.target.value || null)
}
className="flex h-10 w-full rounded-md border border-border-default bg-background-elevated px-3 py-2 text-sm text-foreground-default focus:outline-none focus:ring-2 focus:ring-primary-500/40 focus:border-primary-500"
>
<option value="">Select team size</option>
{TEAM_SIZES.map((size) => (
<option key={size.value} value={size.value}>
{size.label}
</option>
))}
</select>
</div>
</div>
<div className="space-y-2">
<label
htmlFor="admin-languages-spoken"
className="text-sm font-medium text-foreground-default"
>
Languages Spoken
</label>
<MultiSelect
id="admin-languages-spoken"
options={[...LANGUAGES]}
selected={pro.languagesSpoken || []}
onChange={(values) =>
onUpdateField(
"languagesSpoken",
values.length > 0 ? values : null,
)
}
placeholder="Select languages"
/>
</div>
</div>
</CollapsibleCard>
);
}
|