Files
website-astro-stefanimhoff.de/src/components/Text.tsx
2023-04-04 19:41:37 +02:00

29 lines
483 B
TypeScript

import cx from 'classnames';
import type { ComponentChild, FunctionalComponent } from 'preact';
interface Props {
as?: any;
class?: string;
children: ComponentChild;
}
export const Text: FunctionalComponent<Props> = ({
as = 'p',
class: className,
children,
...props
}) => {
const Tag = as;
const classes = cx(
'text-3 font-normal tracking-normal mbe-10 mbs-0 dark:font-light',
className
);
return (
<Tag class={classes} {...props}>
{children}
</Tag>
);
};