aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/components/base/Paragraph.astro
blob: ffb1030d220648a507651914a59366c1958cafed (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>