diff --git a/apps/code/src/renderer/features/command-center/components/CommandCenterToolbar.tsx b/apps/code/src/renderer/features/command-center/components/CommandCenterToolbar.tsx index eaf011c6d..60574aa6a 100644 --- a/apps/code/src/renderer/features/command-center/components/CommandCenterToolbar.tsx +++ b/apps/code/src/renderer/features/command-center/components/CommandCenterToolbar.tsx @@ -15,13 +15,55 @@ import { useCommandCenterStore, } from "../stores/commandCenterStore"; -const LAYOUT_OPTIONS: { value: LayoutPreset; label: string }[] = [ - { value: "1x1", label: "1x1" }, - { value: "2x1", label: "2x1" }, - { value: "1x2", label: "1x2" }, - { value: "2x2", label: "2x2" }, - { value: "3x2", label: "3x2" }, - { value: "3x3", label: "3x3" }, +function LayoutIcon({ cols, rows }: { cols: number; rows: number }) { + const size = 14; + const gap = 1.5; + const cellW = (size - gap * (cols - 1)) / cols; + const cellH = (size - gap * (rows - 1)) / rows; + + const rects: React.ReactElement[] = []; + for (let r = 0; r < rows; r++) { + for (let c = 0; c < cols; c++) { + rects.push( + , + ); + } + } + + return ( + + {rects} + + ); +} + +const LAYOUT_OPTIONS: { + value: LayoutPreset; + label: string; + cols: number; + rows: number; +}[] = [ + { value: "1x1", label: "1x1", cols: 1, rows: 1 }, + { value: "2x1", label: "2x1", cols: 2, rows: 1 }, + { value: "1x2", label: "1x2", cols: 1, rows: 2 }, + { value: "2x2", label: "2x2", cols: 2, rows: 2 }, + { value: "3x2", label: "3x2", cols: 3, rows: 2 }, + { value: "3x3", label: "3x3", cols: 3, rows: 3 }, ]; interface CommandCenterToolbarProps { @@ -86,7 +128,10 @@ export function CommandCenterToolbar({ {LAYOUT_OPTIONS.map((opt) => ( - {opt.label} + + + {opt.label} + ))}