blob: 08fbbdd60d26fff45fe099c44dda10f0955b2aa3 (
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 ? text : <slot />}
</p>
|