/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import { useTranslation } from "@plane/i18n"; import { Tooltip } from "@makeplane/propel/components/tooltip"; import type { TBaseLayoutType } from "@plane/types"; import { cn } from "@plane/utils"; import { usePlatformOS } from "@/hooks/use-platform-os"; import { BASE_LAYOUTS } from "./constants"; type Props = { layouts?: TBaseLayoutType[]; onChange: (layout: TBaseLayoutType) => void; selectedLayout: TBaseLayoutType; }; export function LayoutSwitcher(props: Props) { const { layouts, onChange, selectedLayout } = props; const { isMobile } = usePlatformOS(); const { t } = useTranslation(); const handleOnChange = (layoutKey: TBaseLayoutType) => { if (selectedLayout !== layoutKey) { onChange(layoutKey); } }; return (
{BASE_LAYOUTS.map((layout) => { if (layouts && !layouts.includes(layout.key)) return null; const Icon = layout.icon; return ( ); })}
); }