import { useState } from 'react'; import { useConnectionStore } from '../../store/connectionStore'; import type { SupportType } from '../../types/connection'; import { SteelDatabaseModal, type SteelShape } from '../SteelDatabaseModal'; export const SupportInput = () => { const { support, setSupport, materials, setMaterials } = useConnectionStore(); const [isModalOpen, setIsModalOpen] = useState(false); const supportTypes: { value: SupportType; label: string }[] = [ { value: 'column-flange', label: 'Column flange' }, { value: 'hss-column', label: 'HSS Column' }, { value: 'column-web', label: 'Column web' }, { value: 'hss-beam', label: 'HSS Beam' }, { value: 'beam-web', label: 'Beam web' }, ]; const handleShapeSelect = (shape: SteelShape) => { setSupport({ designation: shape.designation, d: shape.d, tw: shape.tw, tf: shape.tf, bf: shape.bf, }); }; return ( <>
Support Type
{supportTypes.map(({ value, label }) => ( ))}
setSupport({ designation: e.target.value })} className="input-field-wide" style={{ maxWidth: '150px' }} />
(If checked, the support will have twice the load)
Yield Strength Fy setMaterials({ support: { ...materials.support, fy: Number(e.target.value) } })} className="input-field" /> ksi
Tensile Strength Fu setMaterials({ support: { ...materials.support, fu: Number(e.target.value) } })} className="input-field" /> ksi
setIsModalOpen(false)} onSelect={handleShapeSelect} title="Select Support Shape" /> ); };