Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit efa0ebe

Browse files
committedApr 1, 2025··
fix: add Project and Playground icons for command bar
1 parent f7dbfe1 commit efa0ebe

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎frontend/src/component/layout/MainLayout/NavigationSidebar/IconRenderer.tsx

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { ComponentProps, FC } from 'react';
12
import EmptyIcon from '@mui/icons-material/CheckBoxOutlineBlankOutlined';
23
import type SvgIcon from '@mui/material/SvgIcon/SvgIcon';
34
import ApplicationsIcon from '@mui/icons-material/AppsOutlined';
@@ -29,10 +30,14 @@ import GitHubIcon from '@mui/icons-material/GitHub';
2930
import LibraryBooksIcon from '@mui/icons-material/LibraryBooks';
3031
import FactCheckOutlinedIcon from '@mui/icons-material/FactCheckOutlined';
3132
import PersonalDashboardIcon from '@mui/icons-material/DashboardOutlined';
32-
import type { FC } from 'react';
33+
import { ProjectIcon } from 'component/common/ProjectIcon/ProjectIcon';
34+
import PlaygroundIcon from '@mui/icons-material/AutoFixNormal';
3335

3436
// TODO: move to routes
35-
const icons: Record<string, typeof SvgIcon> = {
37+
const icons: Record<
38+
string,
39+
typeof SvgIcon | FC<ComponentProps<typeof SvgIcon>>
40+
> = {
3641
'/search': SearchIcon,
3742
'/applications': ApplicationsIcon,
3843
'/context': ContextFieldsIcon,
@@ -60,6 +65,8 @@ const icons: Record<string, typeof SvgIcon> = {
6065
'/history': EventLogIcon,
6166
'/release-templates': FactCheckOutlinedIcon,
6267
'/personal': PersonalDashboardIcon,
68+
'/projects': ProjectIcon,
69+
'/playground': PlaygroundIcon,
6370
GitHub: GitHubIcon,
6471
Documentation: LibraryBooksIcon,
6572
};
@@ -69,7 +76,6 @@ const findIcon = (key: string) => {
6976
};
7077

7178
export const IconRenderer: FC<{ path: string }> = ({ path }) => {
72-
const IconComponent = findIcon(path); // Fallback to 'default' if the type is not found
73-
79+
const IconComponent = findIcon(path);
7480
return <IconComponent />;
7581
};

0 commit comments

Comments
 (0)
Please sign in to comment.