blob: 832b2963063dd3e507e89facc2358e89b94fd0e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
---
import type { HTMLAttributes } from 'astro/types';
const sizes = {
xs: 'text-xs',
sm: 'text-sm',
md: 'text-md',
lg: 'text-lg',
xl: 'text-xl',
};
interface Props extends HTMLAttributes<'p'> {
text?: string
size?: keyof typeof sizes
}
const {
text = '',
size = 'md',
...props
} = Astro.props;
const className = [
sizes[size],
props.class,
].join(' ');
---
<p class={className} {...props}>
{text || <slot />}
</p>
|