11import * as Ariakit from "@ariakit/react" ;
22import type { RuntimeEnvironment } from "@trigger.dev/database" ;
33import {
4- startOfDay ,
54 endOfDay ,
6- startOfWeek ,
5+ endOfMonth ,
76 endOfWeek ,
7+ isSaturday ,
8+ isSunday ,
9+ previousSaturday ,
10+ startOfDay ,
811 startOfMonth ,
9- endOfMonth ,
12+ startOfWeek ,
1013 startOfYear ,
1114 subDays ,
12- subWeeks ,
1315 subMonths ,
14- previousSaturday ,
15- isSaturday ,
16- isSunday ,
16+ subWeeks ,
1717} from "date-fns" ;
1818import parse from "parse-duration" ;
19- import { startTransition , useCallback , useEffect , useRef , useState , type ReactNode } from "react" ;
19+ import { startTransition , useCallback , useEffect , useState , type ReactNode } from "react" ;
2020import { AppliedFilter } from "~/components/primitives/AppliedFilter" ;
21- import { DateTimePicker } from "~/components/primitives/DateTimePicker" ;
2221import { DateTime } from "~/components/primitives/DateTime" ;
22+ import { DateTimePicker } from "~/components/primitives/DateTimePicker" ;
2323import { Label } from "~/components/primitives/Label" ;
24+ import { Paragraph } from "~/components/primitives/Paragraph" ;
2425import { RadioButtonCircle } from "~/components/primitives/RadioButton" ;
2526import { ComboboxProvider , SelectPopover , SelectProvider } from "~/components/primitives/Select" ;
2627import { useSearchParams } from "~/hooks/useSearchParam" ;
28+ import { type ShortcutDefinition } from "~/hooks/useShortcutKeys" ;
2729import { cn } from "~/utils/cn" ;
2830import { Button } from "../../primitives/Buttons" ;
2931import { filterIcon } from "./RunFilters" ;
30- import { Paragraph } from "~/components/primitives/Paragraph" ;
31- import { ShortcutDefinition } from "~/hooks/useShortcutKeys" ;
32- import { SpanPresenter } from "~/presenters/v3/SpanPresenter.server" ;
33- import { useLocation } from "@remix-run/react" ;
3432
3533export type DisplayableEnvironment = Pick < RuntimeEnvironment , "type" | "id" > & {
3634 userName ?: string ;
@@ -290,6 +288,7 @@ export interface TimeFilterProps {
290288 to ?: string ;
291289 /** Label name used in the filter display, defaults to "Created" */
292290 labelName ?: string ;
291+ hideLabel ?: boolean ;
293292 applyShortcut ?: ShortcutDefinition | undefined ;
294293 /** Callback when the user applies a time filter selection, receives the applied values */
295294 onValueChange ?: ( values : TimeFilterApplyValues ) => void ;
@@ -301,6 +300,7 @@ export function TimeFilter({
301300 from,
302301 to,
303302 labelName = "Created" ,
303+ hideLabel = false ,
304304 applyShortcut,
305305 onValueChange,
306306} : TimeFilterProps = { } ) {
@@ -324,7 +324,7 @@ export function TimeFilter({
324324 trigger = {
325325 < Ariakit . Select render = { < div className = "group cursor-pointer focus-custom" /> } >
326326 < AppliedFilter
327- label = { constrained . label }
327+ label = { hideLabel ? undefined : constrained . label }
328328 icon = { filterIcon ( "period" ) }
329329 value = { constrained . valueLabel }
330330 removable = { false }
0 commit comments