aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/components/base/Paragraph.astro
diff options
context:
space:
mode:
Diffstat (limited to 'apps/website/src/components/base/Paragraph.astro')
-rw-r--r--apps/website/src/components/base/Paragraph.astro31
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/website/src/components/base/Paragraph.astro b/apps/website/src/components/base/Paragraph.astro
new file mode 100644
index 0000000..08fbbdd
--- /dev/null
+++ b/apps/website/src/components/base/Paragraph.astro
@@ -0,0 +1,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>