migrate to cv2 jsx

This commit is contained in:
nin0 2025-05-16 06:16:52 -04:00
parent 6858283ecc
commit dcd22a9d8c
Signed by: nin0
SSH key fingerprint: SHA256:NOoDnFVvZNFvqfXCIhzr6oCTDImZAbTTuyAysZ8Ufk8
18 changed files with 101 additions and 122 deletions

24
src/components/User.tsx Normal file
View file

@ -0,0 +1,24 @@
import { Section } from "components-jsx/Section";
import { client } from "..";
import { Thumbnail } from "components-jsx/Thumbnail";
import { TextDisplay } from "components-jsx/TextDisplay";
import { br } from "components-jsx/br";
export async function User(props: { id: string }) {
const user = await client.rest.users.get(props.id);
return (
<Section
accessory={
<Thumbnail children={{ url: user.avatarURL("png", 128) }} />
}
>
<TextDisplay>### User</TextDisplay>
<TextDisplay>
{user.globalName || user.username}
<br />
-# @{user.username}
</TextDisplay>
</Section>
);
}