blog.z0x.ca/src/components/Link.astro
z0x 36870785bc
All checks were successful
build dist / build-dist (push) Successful in 32s
refactor: biome lint
2025-04-24 22:12:22 -04:00

27 lines
536 B
Text

---
import { cn } from "@/lib/utils";
type 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>