* 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 <keithwillcode@gmail.com>
33 lines
951 B
TypeScript
33 lines
951 B
TypeScript
import React from "react";
|
|
import "react-calendar/dist/Calendar.css";
|
|
import "react-date-picker/dist/DatePicker.css";
|
|
import PrimitiveDatePicker from "react-date-picker/dist/entry.nostyle";
|
|
|
|
import { Icon } from "@calcom/ui/components/icon";
|
|
import classNames from "@calcom/ui/classNames";
|
|
|
|
type Props = {
|
|
date: Date;
|
|
onDatesChange?: ((date: Date) => void) | undefined;
|
|
className?: string;
|
|
disabled?: boolean;
|
|
minDate?: Date;
|
|
};
|
|
|
|
export const DatePicker = ({ minDate, disabled, date, onDatesChange, className }: Props) => {
|
|
return (
|
|
<PrimitiveDatePicker
|
|
className={classNames(
|
|
"focus:ring-primary-500 focus:border-primary-500 border-default rounded-sm border p-1 pl-2 text-sm",
|
|
className
|
|
)}
|
|
clearIcon={null}
|
|
calendarIcon={<Icon name="calendar" className="text-subtle h-5 w-5" />}
|
|
value={date}
|
|
minDate={minDate}
|
|
disabled={disabled}
|
|
onChange={onDatesChange}
|
|
/>
|
|
);
|
|
};
|