"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 (
muse can email you when a request lands in your library, or when a download
finished but needs your call before it’s filed.
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.
MUSE_AUTH{" "}
to github or{" "}
google to enable sign-in.
Notifications
MUSE_SMTP_HOST and{" "}
MUSE_SMTP_FROM to turn it on.
Account
{anonymous ? (
)}