initial commit

This commit is contained in:
laura 2025-11-06 21:45:58 -03:00
commit e2466b202a
Signed by: w
GPG key ID: BCD2117C99E69817
50 changed files with 4356 additions and 0 deletions

29
islands/Code.tsx Normal file
View file

@ -0,0 +1,29 @@
/**
* Copyright (c) 2025 favewa
* 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 = () => {
const element = (children as any)?.props?.children[0];
element && navigator.clipboard.writeText(element);
};
return (
<button
class="inline-code"
onClick={handleClick}
title="Click to copy"
{...props}
>
<span>{children}</span>
</button>
);
}