/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import * as React from "react"; import { TimelineLayoutIcon, GridLayoutIcon, ListLayoutIcon } from "@plane/propel/icons"; import type { TModuleLayoutOptions } from "@plane/types"; import { cn } from "@plane/utils"; interface ILayoutIcon { className?: string; containerClassName?: string; layoutType: TModuleLayoutOptions; size?: number; withContainer?: boolean; } export function ModuleLayoutIcon(props: ILayoutIcon) { const { layoutType, className = "", containerClassName = "", size = 14, withContainer = false } = props; // get Layout icon const icons = { list: ListLayoutIcon, board: GridLayoutIcon, gantt: TimelineLayoutIcon, }; const Icon = icons[layoutType ?? "list"]; if (!Icon) return null; return ( <> {withContainer ? (
) : ( )} ); }