import { memo } from 'react'; import type { ReactNode } from 'react'; import Box from '@mui/material/Box'; import Card from '@mui/material/Card'; import Typography from '@mui/material/Typography'; import { Avatar } from '../../avatar'; import type { AvatarProps } from '../../avatar'; import { CustomIcon } from '../../custom-icon'; import type { CustomIconProps } from '../../custom-icon'; import { TextWithTooltip } from '../../text-with-tooltip'; import clsx from 'clsx'; import map from 'lodash/map'; import createClasses from './styles'; export interface DictionaryCardProps { /** * Title of the component. */ title: string | ReactNode; /** * Props which will be passed into the avatar component. */ avatarProps?: AvatarProps; /** * Main icon to be placed instead of the avatar (avatarProps will be ignored). */ mainIcon?: CustomIconProps; /** * Items which keys and value will be displayed. */ items: Record; /** * To override default classes. */ classes?: Partial>; } const DictionaryCard = (props: DictionaryCardProps) => { const { avatarProps, mainIcon, title, items, classes } = props; const styles = createClasses(); return ( {mainIcon?.src ? ( ) : ( avatarProps && )} {title} {map(items, (value, key) => ( {value} ))} ); }; DictionaryCard.defaultProps = {}; const m = memo(DictionaryCard); export { m as DictionaryCard };