Skip to content

Commit e8e42d7

Browse files
mc
1 parent 87a7941 commit e8e42d7

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

apps/examples/calcom/components/app/bookings-filters.tsx

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@ import {
1919
MenuPopup,
2020
MenuTrigger,
2121
} from "@coss/ui/components/menu";
22+
import { Separator } from "@coss/ui/components/separator";
2223
import { cn } from "@coss/ui/lib/utils";
23-
import { ListFilterIcon, SearchIcon, XIcon } from "lucide-react";
24+
import {
25+
ChevronsUpDownIcon,
26+
ListFilterIcon,
27+
SearchIcon,
28+
XIcon,
29+
} from "lucide-react";
2430
import { useEffect, useRef, useState } from "react";
2531

2632
import type { Booking } from "@/lib/mock-bookings-data";
@@ -344,8 +350,21 @@ function ActiveFilterComponent({
344350
open={open}
345351
value={selectedOptions}
346352
>
347-
<ComboboxTrigger render={<Button size="sm" variant="outline" />}>
353+
<ComboboxTrigger
354+
render={
355+
<Button
356+
className={
357+
selectedOptions.length === 0 ? "justify-between" : undefined
358+
}
359+
size="sm"
360+
variant="outline"
361+
/>
362+
}
363+
>
348364
{getTriggerText()}
365+
{selectedOptions.length === 0 && (
366+
<ChevronsUpDownIcon className="-me-1!" />
367+
)}
349368
</ComboboxTrigger>
350369
<ComboboxPopup aria-label={`Select ${category.label}`}>
351370
<div className="border-b p-2">
@@ -426,16 +445,25 @@ function BookingsFilters() {
426445
);
427446
})}
428447
</div>
429-
{hasFilters && (
430-
<div className="flex items-center gap-1">
431-
<Button onClick={clearAll} size="sm" variant="ghost">
432-
Clear
433-
</Button>
434-
<Button size="sm" variant="outline">
435-
Save
436-
</Button>
437-
</div>
438-
)}
448+
<div className="flex items-center gap-2">
449+
{hasFilters && (
450+
<>
451+
<div className="flex items-center gap-1">
452+
<Button onClick={clearAll} size="sm" variant="ghost">
453+
Clear
454+
</Button>
455+
<Button size="sm" variant="outline">
456+
Save
457+
</Button>
458+
</div>
459+
<Separator className="my-1" orientation="vertical" />
460+
</>
461+
)}
462+
<Button size="sm" variant="outline">
463+
Saved Filters
464+
<ChevronsUpDownIcon />
465+
</Button>
466+
</div>
439467
</div>
440468
);
441469
}

0 commit comments

Comments
 (0)