2024-09-01 14:01:45 +02:00
|
|
|
import { translationAtom } from "@/atoms/translations-atom";
|
2024-10-04 11:15:54 +02:00
|
|
|
import { turnOffNotificationsAtom } from "@/atoms/user-settings-atom";
|
2024-09-01 14:01:45 +02:00
|
|
|
import { useAtom, useAtomValue } from "jotai";
|
2024-01-16 08:33:43 +01:00
|
|
|
|
|
|
|
const TurnOffNotificationsToggle = () => {
|
|
|
|
const [turnOffNotifications, setTurnOffNotifications] = useAtom(
|
2024-09-01 14:01:45 +02:00
|
|
|
turnOffNotificationsAtom,
|
2024-01-16 08:33:43 +01:00
|
|
|
);
|
2024-09-01 14:01:45 +02:00
|
|
|
const t = useAtomValue(translationAtom);
|
2024-01-16 08:33:43 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="flex flex-col gap-2">
|
2024-09-01 14:01:45 +02:00
|
|
|
<p className="text-sm font-medium">
|
2024-09-03 09:34:58 +02:00
|
|
|
{t("SETTINGS.TURN_OFF_NOTIFICATIONS.TITLE")}
|
2024-09-01 14:01:45 +02:00
|
|
|
</p>
|
2024-01-16 08:33:43 +01:00
|
|
|
<p className="text-xs text-base-content/80">
|
2024-09-03 09:34:58 +02:00
|
|
|
{t("SETTINGS.TURN_OFF_NOTIFICATIONS.DESCRIPTION")}
|
2024-01-16 08:33:43 +01:00
|
|
|
</p>
|
|
|
|
<input
|
|
|
|
type="checkbox"
|
|
|
|
className="toggle"
|
|
|
|
checked={turnOffNotifications}
|
|
|
|
onClick={() => {
|
|
|
|
setTurnOffNotifications(!turnOffNotifications);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default TurnOffNotificationsToggle;
|