From a730e05645128224be7b49b36bd15f4f81303caa Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Tue, 22 Jul 2025 18:52:54 +0300 Subject: Buttons fix --- src/components/ui/HeroButton.astro | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/components/ui/HeroButton.astro (limited to 'src/components/ui/HeroButton.astro') diff --git a/src/components/ui/HeroButton.astro b/src/components/ui/HeroButton.astro new file mode 100644 index 0000000..f7a07c6 --- /dev/null +++ b/src/components/ui/HeroButton.astro @@ -0,0 +1,52 @@ +--- +import { Icon } from 'astro-icon/components'; +import { twMerge } from 'tailwind-merge'; +import type { CallToAction as Props } from '~/types'; + +const { + variant = 'secondary', + target, + text = Astro.slots.render('default'), + icon = '', + class: className = '', + type, + ...rest +} = Astro.props; + +const variants = { + primary: 'btn-primary', + secondary: 'btn-secondary', + tertiary: 'btn btn-tertiary', + link: 'cursor-pointer hover:text-primary', +}; +--- + +{ + type === 'button' || type === 'submit' || type === 'reset' ? ( + + ) : ( + + + + {icon && } + + + + ) +} -- cgit v1.2.3