From c67f114cde139c4e5c565a4965d32fbc71d7c93d Mon Sep 17 00:00:00 2001 From: Johngreen Date: Tue, 10 Feb 2026 16:28:10 +0900 Subject: [PATCH] fix: custom select dropdown, modal styling, memo label wrap, modal button padding --- .../app/[tenant]/inspections/[id]/page.tsx | 85 ++++++++++++++++--- dashboard/app/[tenant]/inspections/page.tsx | 4 +- dashboard/app/globals.css | 84 +++++++++++++++++- 3 files changed, 156 insertions(+), 17 deletions(-) diff --git a/dashboard/app/[tenant]/inspections/[id]/page.tsx b/dashboard/app/[tenant]/inspections/[id]/page.tsx index 868d676..a902e59 100644 --- a/dashboard/app/[tenant]/inspections/[id]/page.tsx +++ b/dashboard/app/[tenant]/inspections/[id]/page.tsx @@ -7,6 +7,67 @@ import { useToast } from '@/lib/toast-context'; import { api } from '@/lib/api'; import type { InspectionItemDetail } from '@/lib/types'; +function CustomSelect({ + value, + options, + onChange, + disabled, + placeholder, +}: { + value: string; + options: string[]; + onChange: (val: string) => void; + disabled?: boolean; + placeholder?: string; +}) { + const [open, setOpen] = useState(false); + const ref = useRef(null); + + useEffect(() => { + if (!open) return; + const handler = (e: MouseEvent) => { + if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false); + }; + document.addEventListener('mousedown', handler); + return () => document.removeEventListener('mousedown', handler); + }, [open]); + + const displayLabel = value || placeholder || '선택하세요'; + + return ( +
+ + {open && ( +
    +
  • { onChange(''); setOpen(false); }} + > + {placeholder || '선택하세요'} +
  • + {options.map((opt) => ( +
  • { onChange(opt); setOpen(false); }} + > + {opt} +
  • + ))} +
+ )} +
+ ); +} + interface LocalValues { [templateItemId: string]: { value_numeric?: number | null; @@ -314,17 +375,13 @@ export default function InspectionDetailPage() { {item.data_type === 'select' && (
- + placeholder="선택하세요" + />
)} @@ -335,19 +392,19 @@ export default function InspectionDetailPage() { {showCompleteModal && (
setShowCompleteModal(false)}> -
e.stopPropagation()}> +
e.stopPropagation()}>

검사 완료

-
+

{filledCount}/{totalCount} 항목 입력 완료

-
- +
+