Created select account input

This commit is contained in:
2025-05-12 21:40:48 +02:00
parent c54584550f
commit 3772dce01c
8 changed files with 86 additions and 14 deletions

View File

@ -0,0 +1,25 @@
import { Account } from "../api/AccountApi";
import { ServerApi } from "../api/ServerApi";
import { useDarkTheme } from "../hooks/context_providers/DarkThemeProvider";
import { toBase64 } from "@jsonjoy.com/base64";
export function AccountIconWidget(p: { account: Account }): React.ReactElement {
const darkTheme = useDarkTheme();
return (
<img
style={{
height: "1.5em",
width: "1.5em",
backgroundColor: darkTheme.enabled ? "white" : "black",
mask: `url("data:image/svg+xml;base64,${toBase64(
new TextEncoder().encode(
ServerApi.Config.accounts_types.find(
(t) => t.code === p.account.type
)!.icon
)
)}")`,
}}
/>
);
}