Files
365devnet/src/components/widgets/CallToAction.astro
2023-09-02 18:02:45 -04:00

55 lines
1.5 KiB
Plaintext

---
import WidgetWrapper from '../ui/WidgetWrapper.astro';
import type { CallToAction, Widget } from '~/types';
import Headline from '~/components/ui/Headline.astro';
import Button from "~/components/ui/Button.astro"
interface Props extends Widget {
title?: string;
subtitle?: string;
tagline?: string;
callToAction?: CallToAction;
}
const {
title = await Astro.slots.render('title'),
subtitle = await Astro.slots.render('subtitle'),
tagline = await Astro.slots.render('tagline'),
callToAction = await Astro.slots.render('callToAction'),
id,
isDark = false,
classes = {},
bg = await Astro.slots.render('bg'),
} = Astro.props as Props;
---
<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-6xl mx-auto ${classes?.container ?? ''}`} bg={bg}>
<div
class="max-w-3xl mx-auto text-center p-6 rounded-md shadow-xl dark:shadow-none dark:border dark:border-slate-600"
>
<Headline
title={title}
subtitle={subtitle}
tagline={tagline}
classes={{
container: 'mb-0 md:mb-0',
title: 'text-4xl md:text-4xl font-bold leading-tighter tracking-tighter mb-4 font-heading',
subtitle: 'text-xl text-muted dark:text-slate-400',
}}
/>
{
typeof callToAction === 'string' ? (
<Fragment set:html={callToAction} />
) : (
callToAction &&
callToAction.text && (
<div class="mt-6 max-w-xs mx-auto">
<Button variant="primary" {...callToAction} class="w-full sm:w-auto" />
</div>
)
)
}
</div>
</WidgetWrapper>