Skip to content

Commit

Permalink
fix(badge-icons): some primary icons are not present in the svg-icons…
Browse files Browse the repository at this point in the history
… or Icons
  • Loading branch information
MahtabBukhari committed Oct 22, 2024
1 parent 23f6df5 commit 636496c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/common/TypeBadge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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':
Expand Down

0 comments on commit 636496c

Please sign in to comment.