diff options
Diffstat (limited to 'src/components/Link.astro')
| -rw-r--r-- | src/components/Link.astro | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/components/Link.astro b/src/components/Link.astro new file mode 100644 index 0000000..6d434b1 --- /dev/null +++ b/src/components/Link.astro @@ -0,0 +1,27 @@ +--- +import { cn } from '@/lib/utils' + +interface Props { + href: string + external?: boolean + class?: string + underline?: boolean + [key: string]: any +} + +const { href, external, class: className, underline, ...rest } = Astro.props +--- + +<a + href={href} + target={external ? '_blank' : '_self'} + class={cn( + 'inline-block transition-colors duration-300 ease-in-out', + underline && + 'underline decoration-muted-foreground underline-offset-[3px] hover:decoration-foreground', + className, + )} + {...rest} +> + <slot /> +</a> |
