"use client"; /** * FullscreenDialog — 전체화면 토글이 포함된 공통 Dialog * * 사용법: * * {children} * * * footer prop으로 하단 버튼 영역 커스텀 가능 */ import React, { useState } from "react"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Maximize2, Minimize2 } from "lucide-react"; import { cn } from "@/lib/utils"; interface FullscreenDialogProps { open: boolean; onOpenChange: (open: boolean) => void; title: React.ReactNode; description?: React.ReactNode; children: React.ReactNode; footer?: React.ReactNode; /** 기본 모달 최대 너비 (기본: "max-w-5xl") */ defaultMaxWidth?: string; /** 기본 모달 너비 (기본: "w-[95vw]") */ defaultWidth?: string; className?: string; } export function FullscreenDialog({ open, onOpenChange, title, description, children, footer, defaultMaxWidth = "max-w-5xl", defaultWidth = "w-[95vw]", className, }: FullscreenDialogProps) { const [isFullscreen, setIsFullscreen] = useState(false); const handleOpenChange = (v: boolean) => { if (!v) setIsFullscreen(false); onOpenChange(v); }; return (
{typeof title === "string" ? {title} : title} {description && ( typeof description === "string" ? {description} : description )}
{children}
{footer && ( {footer} )}
); }