From 636496c2729c490a954464d8ab92ad86a54c5da5 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Tue, 22 Oct 2024 19:34:02 +0500 Subject: [PATCH] fix(badge-icons): some primary icons are not present in the svg-icons or Icons --- src/components/common/TypeBadge/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/common/TypeBadge/index.tsx b/src/components/common/TypeBadge/index.tsx index 510c57397..e68b00178 100644 --- a/src/components/common/TypeBadge/index.tsx +++ b/src/components/common/TypeBadge/index.tsx @@ -2,6 +2,7 @@ import styled from 'styled-components' import { useSchemaStore } from '~/stores/useSchemaStore' import { colors } from '~/utils/colors' import { Flex } from '../Flex' +import { Icons } from '~/components/Icons' type Props = { type: string @@ -21,7 +22,9 @@ export const TypeBadge = ({ type }: Props) => { const primaryColor = normalizedSchemasByType[type]?.primary_color const primaryIcon = normalizedSchemasByType[type]?.icon - const icon = primaryIcon ? `svg-icons/${primaryIcon}.svg` : null + const isIconPresent = primaryIcon && primaryIcon in Icons + + const icon = isIconPresent ? `svg-icons/${primaryIcon}.svg` : null switch (nodeType) { case 'video':