Added deeplinks, added qr code login, added settings, other stuff

This commit is contained in:
Alois 2026-04-10 19:44:08 +02:00
commit 8ff8bd9528
32 changed files with 917 additions and 78 deletions

View file

@ -0,0 +1,35 @@
import { Label } from "@tensamin/ui/cmp/label";
import { Switch as UISwitch } from "@tensamin/ui/cmp/switch";
import { useEffect, useState } from "react";
import { settingsStorageDefaults } from "@tensamin/shared/settings";
import { useStorage } from "@tensamin/storage/context";
export function Switch({
label,
id,
}: {
label: string;
id: keyof typeof settingsStorageDefaults;
}) {
const { save, load } = useStorage();
const [value, setValue] = useState<boolean>(settingsStorageDefaults[id]);
useEffect(() => {
load(id).then((value) => setValue(value));
}, [id, load]);
return (
<div className="flex gap-1">
<UISwitch
id={id}
checked={value}
onCheckedChange={(value) => {
setValue(value);
save(id, value);
}}
/>
<Label htmlFor={id}>{label}</Label>
</div>
);
}