first commit

This commit is contained in:
2026-07-16 20:48:43 -03:00
commit 5696cee264
1111 changed files with 322270 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
import dayjs from "dayjs";
import "dayjs/locale/es";
import { create } from "zustand";
dayjs.locale("es");
interface ITimePickerStore {
visible: boolean;
timeFraction: number;
value: dayjs.Dayjs;
defaultValue: dayjs.Dayjs;
onAccept: (newDay: dayjs.Dayjs) => void;
setTimeFraction: (timeFraction: number) => void;
setValue: (value: dayjs.Dayjs) => void;
setDefaultValue: (value: dayjs.Dayjs) => void;
show: (onAccept: (newDay: dayjs.Dayjs) => void) => void;
hide: () => void;
}
export type TimePickerState = ITimePickerStore;
const useTimePickerStore = create<TimePickerState>()((set) => ({
visible: false,
timeFraction: 15,
value: dayjs(new Date()).hour(8).minute(0),
defaultValue: dayjs(new Date()),
onAccept: () => {},
setTimeFraction(timeFraction) {
set(() => ({
timeFraction: timeFraction,
}));
},
setDefaultValue(value) {
set(() => ({
defaultValue: value,
}));
},
setValue(value) {
set(() => ({
value: value,
}));
},
show: (onAccept: (newDay: dayjs.Dayjs) => void) =>
set(() => ({
visible: true,
onAccept: onAccept,
})),
hide: () =>
set(() => ({
visible: false,
onAccept: () => {},
})),
}));
export { useTimePickerStore };