Files
plane/apps/web/core/components/modules/module-layout-icon.tsx
T
Prateek ShouryaandGitHub 9cfde896b3 [WEB-5134] refactor: update web ESLint configuration and refactor imports to use type imports (#7957)
* [WEB-5134] refactor: update `web` ESLint configuration and refactor imports to use type imports

- Enhanced ESLint configuration by adding new rules for import consistency and type imports.
- Refactored multiple files to replace regular imports with type imports for better clarity and performance.
- Ensured consistent use of type imports across the application to align with TypeScript best practices.

* refactor: standardize type imports across components

- Updated multiple files to replace regular imports with type imports for improved clarity and consistency.
- Ensured adherence to TypeScript best practices in the rich filters and issue layouts components.
2025-10-14 16:45:07 +05:30

39 lines
1.0 KiB
TypeScript

import * as React from "react";
import { GanttChartSquare, LayoutGrid, List } from "lucide-react";
import type { 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)} />
)}
</>
);
};