plane/apps/web/core/components/modules/module-layout-icon.tsx
sriram veeraghanta 944b873184
chore: move all services inside the apps folder (#7321)
* chore: move all services inside the apps folder

* chore: rename apiserver to server
2025-07-03 00:44:13 +05:30

39 lines
1.0 KiB
TypeScript

import * as React from "react";
import { GanttChartSquare, LayoutGrid, List } from "lucide-react";
import { TModuleLayoutOptions } from "@plane/types";
import { cn } from "@plane/utils";
interface ILayoutIcon {
className?: string;
containerClassName?: string;
layoutType: TModuleLayoutOptions;
size?: number;
withContainer?: boolean;
}
export const ModuleLayoutIcon: React.FC<ILayoutIcon> = (props) => {
const { layoutType, className = "", containerClassName = "", size = 14, withContainer = false } = props;
// get Layout icon
const icons = {
list: List,
board: LayoutGrid,
gantt: GanttChartSquare,
};
const Icon = icons[layoutType ?? "list"];
if (!Icon) return null;
return (
<>
{withContainer ? (
<div className={cn("flex items-center justify-center border rounded p-0.5 flex-shrink-0", containerClassName)}>
<Icon size={size} className={cn(className)} />
</div>
) : (
<Icon size={size} className={cn("flex-shrink-0", className)} />
)}
</>
);
};