diff --git a/src/App.jsx b/src/App.jsx index ddac2f8..3def8ec 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -29,6 +29,21 @@ function App() { const sheetName = workbook.SheetNames[0]; const worksheet = workbook.Sheets[sheetName]; const jsonData = utils.sheet_to_json(worksheet, {raw:true}); + + if (jsonData.length === 0) { + alert("파일에 데이터가 없습니다."); + return; + } + + const columns = Object.keys(jsonData[0]); + const requiredColumns = ['address', 'amount']; + + if (columns.length !== 2 || + !requiredColumns.every(col => columns.includes(col))) { + alert("양식이 맞지 않습니다."); + return; + } + let total = totalAmount; const filteredData = jsonData.filter(row => {