import { motion, AnimatePresence } from "framer-motion";
import { useUIStore } from "../../stores/useUIStore";
import { useResizable } from "../../hooks/useResizable";
import { TopBar } from "./TopBar";
import { LeftSidebar } from "./LeftSidebar";
import { RightSidebar } from "./RightSidebar";
import { BottomBar } from "./BottomBar";
import { ChatPanel } from "../chat/ChatPanel";
import { CodeEditor } from "../editor/CodeEditor";
import { CommandPalette } from "../palette/CommandPalette";
function ResizeHandle({
axis,
onPointerDown,
cursor,
}: {
axis: "x" | "y";
onPointerDown: (e: React.PointerEvent) => void;
cursor: string;
}) {
return (
{ e.currentTarget.style.background = 'var(--accent)'; }}
onMouseLeave={(e) => { e.currentTarget.style.background = 'var(--border)'; }}
/>
);
}
export function AppShell() {
const {
leftOpen,
rightOpen,
bottomOpen,
leftWidth,
rightWidth,
bottomHeight,
setLeftWidth,
setRightWidth,
setBottomHeight,
} = useUIStore();
const leftResize = useResizable({
axis: "x",
min: 200,
max: 480,
value: leftWidth,
onChange: setLeftWidth,
});
const rightResize = useResizable({
axis: "x",
min: 280,
max: 560,
value: rightWidth,
onChange: setRightWidth,
});
const bottomResize = useResizable({
axis: "y",
min: 160,
max: 520,
value: bottomHeight,
onChange: setBottomHeight,
});
return (
{}
{leftOpen && (
)}
{leftOpen && (
)}
{rightOpen && (
)}
{rightOpen && (
)}
{bottomOpen && (
)}
{bottomOpen && (
)}
{}
{leftOpen && (
)}
{rightOpen && (
)}
);
}