import clsx from 'clsx'; import { memo } from 'react'; import makeStyles from '@mui/styles/makeStyles'; import type { Theme } from '../@styles/theme-provider'; const createClasses = makeStyles>(theme => ({ root: props => { const color = props.color || 'inherit'; return { ...theme.typography.caption2, display: 'inline-block', borderStyle: 'solid', borderWidth: '1px', borderRadius: theme.spacing(1.5), padding: theme.spacing(0, 1), backgroundColor: theme.palette.common.white, borderColor: color, color }; } })); export interface TextWithBorderProps { /** * Textual to be displayed. */ content: string; /** * Color of the text and border. */ color?: string; /** * Custom class name in case you need to add custom styles to the component. */ className?: string; } const TextWithBorder = (props: TextWithBorderProps) => { const { content, color, className } = props; const classes = createClasses({ color }); return {content}; }; const m = memo(TextWithBorder); export { m as TextWithBorder };