"use client"; import React from "react"; import { Tooltip } from "@plane/propel/tooltip"; import type { TBaseLayoutType } from "@plane/types"; import { usePlatformOS } from "@/hooks/use-platform-os"; import { BASE_LAYOUTS } from "./constants"; type Props = { layouts?: TBaseLayoutType[]; onChange: (layout: TBaseLayoutType) => void; selectedLayout: TBaseLayoutType; }; export const LayoutSwitcher: React.FC = (props) => { const { layouts, onChange, selectedLayout } = props; const { isMobile } = usePlatformOS(); const handleOnChange = (layoutKey: TBaseLayoutType) => { if (selectedLayout !== layoutKey) { onChange(layoutKey); } }; return (
{BASE_LAYOUTS.filter((l) => (layouts ? layouts.includes(l.key) : true)).map((layout) => { const Icon = layout.icon; return ( ); })}
); };