initial commit

This commit is contained in:
laura 2025-10-27 04:10:26 -03:00
commit 30f2b4714d
Signed by: w
GPG key ID: BCD2117C99E69817
43 changed files with 3654 additions and 0 deletions

30
islands/Code.tsx Normal file
View file

@ -0,0 +1,30 @@
/**
* Copyright (c) 2025 xwra
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { ComponentChildren } from "preact";
interface CodeProps {
children: ComponentChildren;
[key: string]: any;
}
export default function Code({ children, ...props }: CodeProps) {
const handleClick = () => {
if (typeof children === "string") {
navigator.clipboard.writeText(children);
}
};
return (
<code
class="inline-code"
onClick={handleClick}
style={{ cursor: "pointer" }}
title={"Click to copy"}
{...props}
>
<span>{children}</span>
</code>
);
}