Files
frontend/apps/sn/app/(map-layout)/map/components/InputSection.tsx
T
swcho 166fc81f7e feat: 감리지적사항 대응
- 노후 하수관로 조회 기능 구현
- 분기 조건 체크
- 파일명 표시 에러 수정
- 셀 클릭 이벤트 수정
- 자체 입력 정보 입력 되게 수정
- 단위 추가
- 하수맨홀 뚜껑재질 코드표 추가
2025-07-08 19:38:00 +09:00

50 lines
1.8 KiB
TypeScript

import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from "@common/components/ui";
import React from "react";
interface InputSectionProps {
title: string;
data: { year: string; type: string }[];
sectionKey: string;
onInputChange: (section: string, index: number, field: string, value: string) => void;
}
const InputSection: React.FC<InputSectionProps> = ({ title, data, sectionKey, onInputChange }) => {
return (
<div>
{/* 섹션 제목 */}
<div className="card-header">
<h3 className="text-2xl mx-3 font-medium text-label">{title}</h3>
</div>
{/* 테이블 */}
<div className="card !m-[1.2rem] !p-0r">
<Table variant="secondary" className="w-full">
<TableHeader>
<TableRow>
<TableHead className="border border-gray-300 px-2 py-2 text-sm w-[80px]">년도</TableHead>
<TableHead className="border border-gray-300 px-2 py-2 text-sm w-auto">구분</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{data.map((row, index) => (
<TableRow key={index}>
<TableCell className="border border-gray-300 px-2 py-2 text-sm w-[80px]">
<input
type="text"
value={row.year}
onChange={(e) => onInputChange(sectionKey, index, "year", e.target.value)}
className="w-full text-xl border-radius-0 px-3 py-2 text-base text-center leading-normal"
/>
</TableCell>
<TableCell className="border border-gray-300 px-2 py-2 text-sm text-center leading-normal w-auto">
{row.type}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</div>
</div>
);
};
export default InputSection;