update on the agents and registry side
This commit is contained in:
@@ -49,9 +49,16 @@ const STATUS_TABS = [
|
||||
|
||||
const KNOWN_STATUSES = STATUS_TABS.map((tab) => tab.value).concat('canceled');
|
||||
|
||||
// `short` is what the list shows: the trigger's clock icon already says
|
||||
// "batch", so "Morning Batch" repeated the word on every row.
|
||||
const BATCH_OPTIONS = [
|
||||
{ id: 'all', label: 'All batches', range: 'Across the day' },
|
||||
...BATCHES.map((batch) => ({ id: batch.id, label: batch.label, range: batchRangeLabel(batch) })),
|
||||
{ id: 'all', label: 'All batches', short: 'All batches', range: 'All day' },
|
||||
...BATCHES.map((batch) => ({
|
||||
id: batch.id,
|
||||
label: batch.label,
|
||||
short: batch.label.replace(/\s*batch$/i, ''),
|
||||
range: batchRangeLabel(batch),
|
||||
})),
|
||||
];
|
||||
|
||||
const ALL = 'all';
|
||||
@@ -431,27 +438,34 @@ export default function Deliveries() {
|
||||
/>
|
||||
<ZoneSelector className="w-full sm:w-auto shrink-0" />
|
||||
|
||||
{/* Batch. Sized like the Clients and Milers selects beside it.
|
||||
The trigger names the batch only: SelectItem puts an option's
|
||||
whole content in ItemText, so a bare <SelectValue/> copied the
|
||||
time-range badge into the trigger too and needed 210px for it.
|
||||
The list is a compact label + time, no badges. */}
|
||||
<Select value={batch} onValueChange={setBatch}>
|
||||
<SelectTrigger className="w-full sm:w-auto min-w-[210px] h-10">
|
||||
<SelectTrigger className="w-full sm:w-44" aria-label="Batch">
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<Clock className="h-3.5 w-3.5 text-ink-3 shrink-0" />
|
||||
<SelectValue />
|
||||
<SelectValue>
|
||||
<span className="truncate">{BATCH_OPTIONS.find((o) => o.id === batch)?.label || 'All batches'}</span>
|
||||
</SelectValue>
|
||||
</div>
|
||||
</SelectTrigger>
|
||||
<SelectContent className="w-[300px] p-1.5 shadow-lg rounded-xl">
|
||||
<SelectContent className="min-w-[var(--radix-select-trigger-width)] w-52">
|
||||
{BATCH_OPTIONS.map((option) => (
|
||||
<SelectItem
|
||||
key={option.id}
|
||||
value={option.id}
|
||||
textValue={option.id === 'all' ? 'All batches' : `${option.label} · ${option.range}`}
|
||||
className="py-2 pl-2.5 pr-8 rounded-lg cursor-pointer my-0.5"
|
||||
textValue={option.label}
|
||||
// ItemText is SelectItem's last child and sizes to its text;
|
||||
// stretched, the times line up in one right-hand column.
|
||||
className="cursor-pointer [&>span:last-child]:w-full"
|
||||
>
|
||||
<div className="flex items-center justify-between gap-3 w-full">
|
||||
<span className="font-medium text-ink-1 text-sm">{option.label}</span>
|
||||
<span className="text-[11px] font-medium px-2 py-0.5 rounded-md bg-surface-sunken text-ink-3 border border-border/50 shrink-0">
|
||||
{option.range}
|
||||
</span>
|
||||
</div>
|
||||
<span className="flex w-full items-center justify-between gap-3">
|
||||
<span className="text-ink-1">{option.short}</span>
|
||||
<span className="text-xs text-ink-4 tabular-nums">{option.range}</span>
|
||||
</span>
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
|
||||
Reference in New Issue
Block a user