Skip to content

Commit 89eed9c

Browse files
committed
chore: add componentIcon util
Signed-off-by: aabidsofi19 <[email protected]>
1 parent ca3e8ba commit 89eed9c

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export * from './icons';
66
export * from './redux-persist';
77
export * from './schemas';
88
export * from './theme';
9+
export * from './utils';

src/utils/components.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const componentIcon = ({ kind, model, color }) => {
2+
if (!kind || !model || !color) {
3+
return null;
4+
}
5+
return `/ui/public/static/img/meshmodels/${model}/${color}/${kind.toLowerCase()}-${color}.svg`;
6+
};

src/utils/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './components';

0 commit comments

Comments
 (0)