kgroad-frontend2/src/shared/ui/components/Typography/Typography.tsx
Vladislav Khorev e0e2f5470d renamed folders
2024-02-14 08:04:02 +00:00

20 lines
434 B
TypeScript

import "./Typography.scss";
interface ITypographyProps {
element: string;
children: React.ReactNode;
}
const Typography: React.FC<ITypographyProps> = ({
element,
children,
}: ITypographyProps) => {
const headers: Record<string, React.ReactNode> = {
h2: <h2 className="typography-h2">{children}</h2>,
h3: <h3 className="typography-h3">{children}</h3>,
};
return headers[element];
};
export default Typography;