initial commit
This commit is contained in:
commit
30f2b4714d
43 changed files with 3654 additions and 0 deletions
24
components/Link.tsx
Normal file
24
components/Link.tsx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* Copyright (c) 2025 xwra
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { HTMLAttributes, JSX } from "preact";
|
||||
import { LinkIcon } from "./Icon.tsx";
|
||||
|
||||
interface LinkProps extends HTMLAttributes<HTMLAnchorElement> {
|
||||
href: string;
|
||||
children: JSX.Element | JSX.Element[] | string;
|
||||
noIcon?: boolean;
|
||||
}
|
||||
|
||||
export default function Link(
|
||||
{ children, noIcon = false, ...props }: LinkProps,
|
||||
) {
|
||||
return (
|
||||
<a {...props}>
|
||||
{children}
|
||||
{!noIcon && <LinkIcon size={16} class="link-icon" />}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue