import { usePileCapStore } from '../../store/pileCapStore';
import { DraggableLabel } from './DraggableLabel';
export const ReinforcementDiagram = () => {
const { geometry, reinforcement } = usePileCapStore();
// Global Diagram State
const isLocked = usePileCapStore(state => state.diagramState.isLocked);
const labelPositions = usePileCapStore(state => state.diagramState.labelPositions);
const setDiagramLocked = usePileCapStore(state => state.setDiagramLocked);
const updateLabelPosition = usePileCapStore(state => state.updateLabelPosition);
const getLabelPos = (id: string, defaultX: number, defaultY: number) => {
return labelPositions[id] || { x: defaultX, y: defaultY };
};
const scale = 25;
const padding = 40;
// Dimensions
const width = geometry.length * scale;
const height = (geometry.depth / 12) * scale;
const colW = (geometry.columnWidth / 12) * scale;
const colH = (geometry.columnLength / 12) * scale; // For plan view
const svgWidth = width + padding * 2;
const svgHeight = height + padding * 2 + 150; // Extra space for plan view
// Bar properties
const topCover = (reinforcement.topConcreteCover / 12) * scale;
const bottomCover = (reinforcement.bottomConcreteCover / 12) * scale;
return (
Reinforcement Schematic
{/* Controls */}
);
};