mirror of
https://github.com/jhbruhn/respira.git
synced 2026-03-14 02:38:41 +00:00
Some checks are pending
Build, Test, and Lint / Build, Test, and Lint (push) Waiting to run
Draft Release / Draft Release (push) Waiting to run
Draft Release / Build Web App (push) Blocked by required conditions
Draft Release / Build Release - macos-latest (push) Blocked by required conditions
Draft Release / Build Release - ubuntu-latest (push) Blocked by required conditions
Draft Release / Build Release - windows-latest (push) Blocked by required conditions
Draft Release / Upload to GitHub Release (push) Blocked by required conditions
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import { useShallow } from "zustand/react/shallow";
|
|
import { useMachineStore, usePatternUploaded } from "../stores/useMachineStore";
|
|
import { usePatternStore } from "../stores/usePatternStore";
|
|
import { ConnectionPrompt } from "./ConnectionPrompt";
|
|
import { FileUpload } from "./FileUpload";
|
|
import { PatternSummaryCard } from "./PatternSummaryCard";
|
|
import { ProgressMonitor } from "./ProgressMonitor";
|
|
|
|
export function LeftSidebar() {
|
|
const { isConnected } = useMachineStore(
|
|
useShallow((state) => ({
|
|
isConnected: state.isConnected,
|
|
})),
|
|
);
|
|
|
|
const { pesData } = usePatternStore(
|
|
useShallow((state) => ({
|
|
pesData: state.pesData,
|
|
})),
|
|
);
|
|
|
|
// Derived state: pattern is uploaded if machine has pattern info
|
|
const patternUploaded = usePatternUploaded();
|
|
|
|
return (
|
|
<div className="flex flex-col gap-4 md:gap-5 lg:gap-6 lg:overflow-hidden">
|
|
{/* Connect Button or Browser Hint - Show when disconnected */}
|
|
{!isConnected && <ConnectionPrompt />}
|
|
|
|
{/* Pattern File - Show during upload stage (before pattern is uploaded) */}
|
|
{isConnected && !patternUploaded && <FileUpload />}
|
|
|
|
{/* Compact Pattern Summary - Show after upload (during sewing stages) */}
|
|
{isConnected && patternUploaded && pesData && <PatternSummaryCard />}
|
|
|
|
{/* Progress Monitor - Show when pattern is uploaded */}
|
|
{isConnected && patternUploaded && (
|
|
<div className="lg:flex-1 lg:min-h-0">
|
|
<ProgressMonitor />
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|