/* Copyright 2026 Marimo. All rights reserved. */ import { Grid3x3Icon, ListIcon, PresentationIcon, SquareIcon, } from "lucide-react"; import type React from "react"; import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { getFeatureFlag } from "@/core/config/feature-flag"; import { useLayoutActions, useLayoutState } from "@/core/layout/layout"; import { isWasm } from "@/core/wasm/utils"; import { logNever } from "@/utils/assertNever"; import { Strings } from "@/utils/strings"; import { LAYOUT_TYPES, type LayoutType } from "./types"; export const LayoutSelect: React.FC = () => { const { selectedLayout } = useLayoutState(); const { setLayoutView } = useLayoutActions(); // Layouts are not supported in WASM mode by default, // unless the feature flag is enabled if (isWasm() && !getFeatureFlag("wasm_layouts")) { return null; } return ( ); }; function renderIcon(layoutType: LayoutType) { const Icon = getLayoutIcon(layoutType); return ; } export function getLayoutIcon(layoutType: LayoutType) { switch (layoutType) { case "vertical": return ListIcon; case "grid": return Grid3x3Icon; case "slides": return PresentationIcon; default: logNever(layoutType); return SquareIcon; } } export function displayLayoutName(layoutType: LayoutType) { return Strings.startCase(layoutType); }