From 6924fc24c8d7c4d9281492ff12de583ef26f8927 Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Tue, 22 Jul 2025 16:33:05 +0300 Subject: Add initial pricing --- src/components/widgets/Pricing.astro | 126 +++++++++++++++++------------------ 1 file changed, 63 insertions(+), 63 deletions(-) (limited to 'src/components/widgets/Pricing.astro') diff --git a/src/components/widgets/Pricing.astro b/src/components/widgets/Pricing.astro index 3f20b74..4ab5279 100644 --- a/src/components/widgets/Pricing.astro +++ b/src/components/widgets/Pricing.astro @@ -1,15 +1,15 @@ --- -import { Icon } from 'astro-icon/components'; -import Button from '~/components/ui/Button.astro'; +import type { Pricing as Props } from '~/types'; import Headline from '~/components/ui/Headline.astro'; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; -import type { Pricing as Props } from '~/types'; +import Button from '~/components/ui/Button.astro'; const { - title = '', - subtitle = '', - tagline = '', - prices = [], + title = await Astro.slots.render('title'), + subtitle = await Astro.slots.render('subtitle'), + tagline, + items = [], + actions = [], id, isDark = false, @@ -18,66 +18,66 @@ const { } = Astro.props; --- - - -
-
+ + +
+
{ - prices && - prices.map(({ title, subtitle, price, period, items, callToAction, hasRibbon = false, ribbonTitle }) => ( -
- {price && period && ( -
- {hasRibbon && ribbonTitle && ( -
- - {ribbonTitle} - -
- )} -
- {title && ( -

{title}

- )} - {subtitle &&

{subtitle}

} -
-
- $ - {price} -
- {period} -
- {items && ( -
    - {items.map( - ({ description, icon }) => - description && ( -
  • -
    - -
    - {description} -
  • - ) - )} -
- )} -
- {callToAction && ( -
- {typeof callToAction === 'string' ? ( - - ) : ( - callToAction && - callToAction.href &&
- )} -
+ items && items.length > 0 && items.map((item, index) => ( +
+
+ {item.title && ( +

{item.title}

+ )} +
+ {item.entries && item.entries.length > 0 && ( + + + {item.entries.map((entry) => ( + + + + + ))} + +
{entry.price}
)}
- )) +
+ )) }
+ +
+ {await Astro.slots.render('disclaimer') && ( +
+ )} + + { + actions && actions.length > 0 && ( +
+ {actions.map((action) => ( +
+
+ ))} +
+ ) + } +
-- cgit v1.2.3