mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
43 lines
630 B
Plaintext
43 lines
630 B
Plaintext
---
|
|
export interface Props {
|
|
id?: string;
|
|
href: string;
|
|
class?: string;
|
|
ariaLabel?: string;
|
|
title?: string;
|
|
disabled?: boolean;
|
|
}
|
|
|
|
const {
|
|
id,
|
|
href,
|
|
class: className = "",
|
|
ariaLabel,
|
|
title,
|
|
disabled = false,
|
|
} = Astro.props;
|
|
---
|
|
|
|
{
|
|
disabled ? (
|
|
<span
|
|
id={id}
|
|
class:list={["group inline-block", className]}
|
|
title={title}
|
|
aria-disabled={disabled}
|
|
>
|
|
<slot />
|
|
</span>
|
|
) : (
|
|
<a
|
|
id={id}
|
|
{href}
|
|
class:list={["group inline-block hover:text-accent", className]}
|
|
aria-label={ariaLabel}
|
|
title={title}
|
|
>
|
|
<slot />
|
|
</a>
|
|
)
|
|
}
|