🚀 Auto-deploy: BrainWind atualizado em 14/07/2026 15:18:53
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
|
||||
import { useHydrationStore } from '@/store/hydrationStore';
|
||||
import { SaveModuleDialog } from '@/components/SaveModuleDialog';
|
||||
import { Slider } from '@/components/ui/slider';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
@@ -24,6 +27,23 @@ const PiperackModule: React.FC = () => {
|
||||
const [phiStruct, setPhiStruct] = useState(0.5);
|
||||
const [pipes, setPipes] = useState<PipeDef[]>([]);
|
||||
|
||||
const pendingLoad = useHydrationStore((s) => s.pendingLoad);
|
||||
const clearPendingLoad = useHydrationStore((s) => s.clearPendingLoad);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (pendingLoad && pendingLoad.module === 'piperack') {
|
||||
const p = pendingLoad.inputs as any;
|
||||
if (p.elevation !== undefined) setElevation(p.elevation);
|
||||
if (p.width !== undefined) setWidth(p.width);
|
||||
if (p.height !== undefined) setHeight(p.height);
|
||||
if (p.spacing !== undefined) setSpacing(p.spacing);
|
||||
if (p.numFrames !== undefined) setNumFrames(p.numFrames);
|
||||
if (p.pipes !== undefined) setPipes(p.pipes);
|
||||
if (p.phiStruct !== undefined) setPhiStruct(p.phiStruct);
|
||||
clearPendingLoad();
|
||||
}
|
||||
}, [pendingLoad, clearPendingLoad]);
|
||||
|
||||
const addPipe = () => {
|
||||
setPipes([...pipes, { id: Math.random().toString(36).substr(2, 9), diameter: 0.5, elevationOffset: height / 2 }]);
|
||||
};
|
||||
@@ -91,7 +111,7 @@ const PiperackModule: React.FC = () => {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-[calc(100vh-3.5rem)] md:h-screen bg-background">
|
||||
<header className="shrink-0 flex items-center justify-between px-6 py-4 border-b bg-card">
|
||||
<header className="shrink-0 flex items-center px-6 py-4 border-b bg-card">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="p-2 bg-primary/10 rounded-lg">
|
||||
<Layers className="w-5 h-5 text-primary" />
|
||||
@@ -101,9 +121,6 @@ const PiperackModule: React.FC = () => {
|
||||
<p className="text-sm text-muted-foreground">Vento transversal (Sec. 7 - NBR 6123)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<ExportMenu onExportPDF={handleExportPDF} />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="flex-1 flex flex-col lg:flex-row p-4 gap-4 overflow-hidden bg-muted/30">
|
||||
@@ -403,6 +420,16 @@ const PiperackModule: React.FC = () => {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<div className="flex justify-center bg-background rounded-xl border border-border shadow-sm p-4">
|
||||
<div className="flex flex-col items-end gap-2">
|
||||
<SaveModuleDialog
|
||||
moduleType="piperack"
|
||||
inputs={{ elevation, width, height, spacing, numFrames, pipes, phiStruct }}
|
||||
/>
|
||||
<ExportMenu onExportPDF={handleExportPDF} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SceneCapturePanel />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user