feat(FE-208): enhance DateInput component with range selection and modal support

This commit is contained in:
rstubryan
2025-11-12 16:54:17 +07:00
parent f264474293
commit 4215c6c6ce
5 changed files with 298 additions and 46 deletions
+7 -3
View File
@@ -10,15 +10,19 @@ import {
} from 'react';
import { cn } from '@/lib/helper';
export const useModal = () => {
export const useModal = (isNestingModal = false) => {
const ref = useRef<HTMLDialogElement>(null);
const [open, setOpen] = useState(false);
const openModal = useCallback(() => {
if (!ref.current) return;
ref.current.show();
if (isNestingModal) {
ref.current.showModal();
} else {
ref.current.show();
}
setOpen(true);
}, []);
}, [isNestingModal]);
const closeModal = useCallback(() => {
if (!ref.current) return;