import { IconPredefined, IconPredefinedProps } from '@snack-uikit/icon-predefined'; import { TEST_IDS } from '../../constants'; import { useCardContext } from '../../context'; import styles from './styled.module.scss'; type PictureProps = { src: string; alt: string; }; export type EmblemProps = PictureProps | Pick; function isPictureProps(props: EmblemProps): props is PictureProps { return 'src' in props && 'alt' in props; } export function Emblem(props: EmblemProps) { const { size } = useCardContext(); if (isPictureProps(props)) { return ( {props.alt} ); } return ( ); }