Files
853f9bc436 perf: do not import from @calcom/ui barrel file (#20184)
* Icon and IconName

* Button and ButtonGroup

* UserAvatar

* AvatarGroup

* Avatar

* WizardLayout

* Dialogs

* EmptyScreen

* showToast and TextField

* Editor

* Skeleton

* Skeleton

* TopBanner and showToast

* Button again

* more

* perf: Remove app-store reference from @calcom/ui

* more

* Fixing types

* Icon

* Fixed casing

* dropdown

* more

* Select

* more

* Badge

* List

* more

* Divider

* more

* fix

* fix type check

* refactor

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix type check

* fix

* fix

* fix

* fix

* more

* more

* more

* more

* add index file to components/command

* fix

* fix

* fix

* fix imports

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix build errors

* fix build errors

* fix

---------

Co-authored-by: Keith Williams <[email protected]>
2025-03-19 19:00:55 -03:00

55 lines
1.8 KiB
TypeScript

import dayjs from "@calcom/dayjs";
import { Button } from "@calcom/ui/components/button";
import { ButtonGroup } from "@calcom/ui/components/buttonGroup";
import { useCalendarStore } from "../../state/store";
export function SchedulerHeading() {
const { startDate, endDate, handleDateChange } = useCalendarStore((state) => ({
startDate: dayjs(state.startDate),
endDate: dayjs(state.endDate),
handleDateChange: state.handleDateChange,
}));
return (
<header className="flex flex-none flex-col justify-between py-4 sm:flex-row sm:items-center">
<h1 className="text-emphasis text-xl font-semibold">
{startDate.format("MMM DD")}-{endDate.format("DD")}
<span className="text-subtle">,{startDate.format("YYYY")}</span>
</h1>
<div className="flex items-center space-x-2 rtl:space-x-reverse">
{/* TODO: Renable when we have daily/mobile support */}
{/* <ToggleGroup
options={[
{ label: "Daily", value: "day", disabled: false },
{ label: "Weekly", value: "week", disabled: isSm },
]}
defaultValue={view === "day" ? "day" : "week"}
/> */}
<ButtonGroup combined>
{/* TODO: i18n label with correct view */}
<Button
StartIcon="chevron-left"
variant="icon"
color="secondary"
aria-label="Previous Week"
onClick={() => {
handleDateChange("DECREMENT");
}}
/>
<Button
StartIcon="chevron-right"
variant="icon"
color="secondary"
aria-label="Next Week"
onClick={() => {
handleDateChange("INCREMENT");
}}
/>
</ButtonGroup>
</div>
</header>
);
}