import { ChevronLeft, ChevronRight } from "lucide-react"; import { useCallback } from "react"; import { shallow } from "zustand/shallow"; import dayjs from "@calcom/dayjs"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button, ButtonGroup, ToggleGroup } from "@calcom/ui"; import { Calendar, Columns, Grid } from "@calcom/ui/components/icon"; import { TimeFormatToggle } from "../../components/TimeFormatToggle"; import { useBookerStore } from "../store"; import type { BookerLayout } from "../types"; export function Header({ extraDays, isMobile }: { extraDays: number; isMobile: boolean }) { const [layout, setLayout] = useBookerStore((state) => [state.layout, state.setLayout], shallow); const selectedDateString = useBookerStore((state) => state.selectedDate); const addToSelectedDate = useBookerStore((state) => state.addToSelectedDate); const isSmallCalendar = layout === "small_calendar"; const selectedDate = dayjs(selectedDateString); const onLayoutToggle = useCallback( (newLayout: string) => setLayout(newLayout as BookerLayout), [setLayout] ); if (isMobile) return null; // In month view we only show the layout toggle. if (isSmallCalendar) { return (