import { useState } from "react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "~/components/ui/card"; import { Switch } from "~/components/ui/switch"; import { Button } from "~/components/ui/button"; import { Badge } from "~/components/ui/badge"; import { Separator } from "~/components/ui/separator"; import { Bell, Smartphone, Monitor, Trash2, Send, AlertTriangle, Info, } from "lucide-react"; import InstallApp from "./install-app"; export default function NotificationSettings() { // TODO: Replace with actual user data const [pushEnabled, setPushEnabled] = useState(false); const [events, setEvents] = useState([ { id: "new-message", label: "New Message", enabled: true }, { id: "comment-reply", label: "Comment Reply", enabled: true }, { id: "app-update", label: "App Update", enabled: false }, { id: "weekly-digest", label: "Weekly Digest", enabled: true }, { id: "security-alert", label: "Security Alert", enabled: true }, { id: "friend-request", label: "Friend Request", enabled: false }, ]); const [subscriptions] = useState([ { id: "1", name: "iPhone 15 Pro", type: "mobile", status: "active", lastSeen: "2 hours ago", }, { id: "2", name: "MacBook Pro", type: "desktop", status: "active", lastSeen: "5 minutes ago", }, { id: "3", name: "Chrome on Windows", type: "desktop", status: "revoked", lastSeen: "3 days ago", }, ]); const toggleEvent = (eventId: string) => { setEvents( events.map((event) => event.id === eventId ? { ...event, enabled: !event.enabled } : event ) ); }; return (
Gérez vos préférences de notification et vos appareils abonnés.
Notifications
Recevez des notifications même lorsque l’application est fermée.
{event.label}
{event.id === "new-message" && "Get notified when you receive a new message"} {event.id === "comment-reply" && "Get notified when someone replies to your comment"} {event.id === "app-update" && "Get notified when a new app version is available"} {event.id === "weekly-digest" && "Receive a weekly summary of your activity"} {event.id === "security-alert" && "Important security notifications and alerts"} {event.id === "friend-request" && "Get notified when someone sends you a friend request"}
{subscription.name}
{subscription.status === "revoked" && (Last seen {subscription.lastSeen}
No subscribed devices found
Enable push notifications to add this device