import { useState } from 'react'; import { useConnectionStore } from '../../store/connectionStore'; import { SteelDatabaseModal, type SteelShape } from '../SteelDatabaseModal'; export const BeamInput = () => { const { beam, setBeam, materials, setMaterials } = useConnectionStore(); const [isModalOpen, setIsModalOpen] = useState(false); const handleShapeSelect = (shape: SteelShape) => { setBeam({ designation: shape.designation, d: shape.d, tw: shape.tw, tf: shape.tf, bf: shape.bf, }); }; return ( <>
Beam Properties
Beam Designation setBeam({ designation: e.target.value })} className="input-field-wide" style={{ maxWidth: '150px' }} />
Beam Gap from Support setBeam({ gapFromSupport: Number(e.target.value) })} className="input-field" /> in
Yield Strength Fy setMaterials({ beam: { ...materials.beam, fy: Number(e.target.value) } })} className="input-field" /> ksi
Tensile Strength Fu setMaterials({ beam: { ...materials.beam, fu: Number(e.target.value) } })} className="input-field" /> ksi
setIsModalOpen(false)} onSelect={handleShapeSelect} title="Select Beam Shape" /> ); };