"use client"; import * as React from "react"; import { motion } from "framer-motion"; import { Bell, BellOff, Mail } from "lucide-react"; import { api, type Me } from "@/lib/api"; import { useToast } from "@/components/toast"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; /** Your own notification settings. Not behind admin on purpose: an address * you cannot change yourself turns into someone else's chore. */ export function Settings({ me, refresh }: { me: Me; refresh: () => void }) { const toast = useToast(); const [email, setEmail] = React.useState(me.email ?? ""); const [notify, setNotify] = React.useState(me.notify ?? true); const [busy, setBusy] = React.useState(false); const dirty = email !== (me.email ?? "") || notify !== (me.notify ?? true); const save = async () => { setBusy(true); try { await api.settings({ email: email.trim(), notify }); toast("Settings saved"); refresh(); } catch (e) { toast((e as Error).message, true); } setBusy(false); }; const googleImplicit = me.provider === "google" && !me.email; // MUSE_AUTH=off means there is no account to attach a preference to, and // PATCH /api/me would 401. Say so rather than offering a form that fails. const anonymous = !me.user; return ( {anonymous && (
Authentication is turned off on this instance, so there is no account to save preferences against. Set MUSE_AUTH{" "} to github or{" "} google to enable sign-in.
)}

Notifications

muse can email you when a request lands in your library, or when a download finished but needs your call before it’s filed.

{!me.mail_configured && (
No SMTP server is configured on this instance, so nothing will actually be sent. Set MUSE_SMTP_HOST and{" "} MUSE_SMTP_FROM to turn it on.
)}

Account

{anonymous ? (

Nobody is signed in — every request is anonymous and every role check reports admin.

) : (
)}

muse is the front door. Playback, playlists and listening history live in Navidrome — this only decides what gets into the library.

); } function Field({ k, v }: { k: string; v: string }) { return ( <>
{k}
{v}
); }