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 | 140x 2x 4x 640x | import { CollapsibleCard } from "../../ui/collapsible";
import type { ProFormSectionProps } from "./types";
import { RUSH_ORDER_PREMIUMS } from "./constants";
import { Zap } from "lucide-react";
import { Select } from "../../ui/select";
import { Checkbox } from "../../ui/checkbox";
/**
* RushOrdersSection component displays rush order configuration.
* Includes a checkbox to enable rush orders and a conditional premium select.
*/
export function RushOrdersSection({ pro, onUpdateField }: ProFormSectionProps) {
return (
<CollapsibleCard
title="Rush Orders"
description="Can this pro accept rush orders?"
icon={<Zap className="h-5 w-5" />}
defaultOpen={pro.acceptsRushOrders}
>
<div className="space-y-4 pt-4">
<Checkbox
id="admin-accepts-rush-orders"
checked={pro.acceptsRushOrders || false}
onChange={(e) => onUpdateField("acceptsRushOrders", e.target.checked)}
>
Accepts rush orders with expedited delivery
</Checkbox>
{pro.acceptsRushOrders && (
<div className="space-y-2 ml-7">
<label
htmlFor="admin-rush-order-premium"
className="block text-xs font-semibold uppercase tracking-wider text-foreground-muted"
>
Rush Order Premium
</label>
<Select
id="admin-rush-order-premium"
value={pro.rushOrderPremium || ""}
onChange={(e) =>
onUpdateField("rushOrderPremium", e.target.value || null)
}
className="w-full"
>
<option value="">Select premium</option>
{RUSH_ORDER_PREMIUMS.map((option) => (
<option key={option.value} value={option.value}>
{option.label}
</option>
))}
</Select>
</div>
)}
</div>
</CollapsibleCard>
);
}
|