import React, { useState } from "react";
export default function CutListCalculator() {
const [boards, setBoards] = useState([{ length: "", width: "", thickness: "", species: "" }]);
const [isLog, setIsLog] = useState(false);
const [resaw, setResaw] = useState(false);
const handleBoardChange = (index, field, value) => {
const newBoards = [...boards];
newBoards[index][field] = value;
setBoards(newBoards);
};
const addBoard = () => {
if (boards.length < 10) {
setBoards([...boards, { length: "", width: "", thickness: "", species: "" }]);
}
};
const removeBoard = (index) => {
const newBoards = boards.filter((_, i) => i !== index);
setBoards(newBoards);
};
const handleCalculate = () => {
alert("Calculate clicked! Logic will be added next.");
};
return (
{boards.map((board, index) => (
{!isLog && (
<>
>
)}
{isLog && (
)}
))}
);
}