This commit is contained in:
freedakgmail
2025-11-23 09:13:25 +08:00
parent 81dbf709aa
commit bade25ff26
378 changed files with 769815 additions and 2334 deletions
@@ -1,16 +1,18 @@
"use client"
import { useState, useEffect } from "react"
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { Button } from "@/components/ui/button"
import { Switch } from "@/components/ui/switch"
import { Label } from "@/components/ui/label"
import { Bell, BellOff, Check, X } from "lucide-react"
import { Bell, BellOff, X, Check } from "lucide-react"
import { useDialog } from "@/components/ui/alert-dialog-custom"
import { requestNotificationPermission, checkUpcomingAnniversaries } from "@/lib/notifications"
import { useFamily } from "@/context/family-context"
import { Alert, AlertDescription } from "@/components/ui/alert"
export function NotificationSettings() {
const { showAlert } = useDialog()
const { treeData } = useFamily()
const [notificationEnabled, setNotificationEnabled] = useState(false)
const [permission, setPermission] = useState<NotificationPermission>("default")
@@ -52,9 +54,9 @@ export function NotificationSettings() {
}
}
const handleDisableNotifications = () => {
const handleDisableNotifications = async () => {
setNotificationEnabled(false)
alert("请在浏览器设置中禁用此网站的通知权限")
await showAlert("请在浏览器设置中禁用此网站的通知权限", "提示")
}
return (