260706_01_ENH: DataTable 버그 수정 및 Date 관련 컴포넌트 추가
This commit is contained in:
27
.tooling/components/ui/calendar.tsx
Normal file
27
.tooling/components/ui/calendar.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { HTMLAttributes } from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export type CalendarDateRange = {
|
||||
from?: Date;
|
||||
to?: Date;
|
||||
};
|
||||
|
||||
type CalendarBaseProps = Omit<HTMLAttributes<HTMLDivElement>, "onSelect">;
|
||||
|
||||
type CalendarSingleProps = CalendarBaseProps & {
|
||||
mode: "single";
|
||||
selected?: Date;
|
||||
onSelect?: (date: Date | undefined) => void;
|
||||
};
|
||||
|
||||
type CalendarRangeProps = CalendarBaseProps & {
|
||||
mode: "range";
|
||||
selected?: CalendarDateRange;
|
||||
onSelect?: (range: CalendarDateRange | undefined) => void;
|
||||
};
|
||||
|
||||
export type CalendarProps = CalendarSingleProps | CalendarRangeProps;
|
||||
|
||||
export function Calendar({ className, ...props }: CalendarProps) {
|
||||
return <div className={cn(className)} data-mode={props.mode} />;
|
||||
}
|
||||
Reference in New Issue
Block a user