settings: - Add actions-brand, brand-config, data-access-brand for brand management - Add admin-file-upload-card, admin-notification-config-card, admin-school-info-card, admin-security-policy-card - Add ai-provider-delete-dialog, ai-provider-selector, brand-config-card - Add security-recent-logins-section, security-two-factor-section - Add config/profile-overview-config, data-access-profile-overview, lib/system-settings-utils questions: - Add batch-operations, import-export-buttons, knowledge-point-selector, options-editor - Add question-bank-results-client, question-cascade-filter, question-content-renderer, utils school: - Add grade-delete-dialog, grade-form-dialog, grade-list-toolbar, grade-overview-cards - Add use-grade-data hook textbooks: - Add textbook-form-fields component - Add use-kp-create, use-kp-delete, use-kp-update hooks
80 lines
2.8 KiB
TypeScript
80 lines
2.8 KiB
TypeScript
"use client"
|
|
|
|
import { useTranslations } from "next-intl"
|
|
import { Bell } from "lucide-react"
|
|
import { type ReactElement } from "react"
|
|
|
|
import { Label } from "@/shared/components/ui/label"
|
|
import { Switch } from "@/shared/components/ui/switch"
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/shared/components/ui/card"
|
|
|
|
export interface NotificationConfigValues {
|
|
notifyNewUser: boolean
|
|
notifyScheduleChange: boolean
|
|
notifyAnnouncement: boolean
|
|
}
|
|
|
|
interface NotificationConfigCardProps {
|
|
values: NotificationConfigValues
|
|
onChange: (key: keyof NotificationConfigValues, value: boolean) => void
|
|
}
|
|
|
|
/**
|
|
* 管理员系统设置 - 通知配置卡片
|
|
*/
|
|
export function NotificationConfigCard({ values, onChange }: NotificationConfigCardProps): ReactElement {
|
|
const t = useTranslations("settings.admin.notificationConfig")
|
|
|
|
return (
|
|
<Card className="shadow-none">
|
|
<CardHeader>
|
|
<div className="flex items-center gap-2">
|
|
<Bell className="h-5 w-5 text-primary" />
|
|
<div>
|
|
<CardTitle className="text-base">{t("title")}</CardTitle>
|
|
<CardDescription>{t("description")}</CardDescription>
|
|
</div>
|
|
</div>
|
|
</CardHeader>
|
|
<CardContent className="space-y-4">
|
|
<div className="flex items-center justify-between">
|
|
<div className="space-y-0.5">
|
|
<Label htmlFor="notify-new-user">{t("notifyNewUser")}</Label>
|
|
<p className="text-sm text-muted-foreground">{t("notifyNewUserDesc")}</p>
|
|
</div>
|
|
<Switch
|
|
id="notify-new-user"
|
|
name="notifyNewUser"
|
|
checked={values.notifyNewUser}
|
|
onCheckedChange={(v) => onChange("notifyNewUser", v)}
|
|
/>
|
|
</div>
|
|
<div className="flex items-center justify-between">
|
|
<div className="space-y-0.5">
|
|
<Label htmlFor="notify-schedule-change">{t("notifyScheduleChange")}</Label>
|
|
<p className="text-sm text-muted-foreground">{t("notifyScheduleChangeDesc")}</p>
|
|
</div>
|
|
<Switch
|
|
id="notify-schedule-change"
|
|
name="notifyScheduleChange"
|
|
checked={values.notifyScheduleChange}
|
|
onCheckedChange={(v) => onChange("notifyScheduleChange", v)}
|
|
/>
|
|
</div>
|
|
<div className="flex items-center justify-between">
|
|
<div className="space-y-0.5">
|
|
<Label htmlFor="notify-announcement">{t("notifyAnnouncement")}</Label>
|
|
<p className="text-sm text-muted-foreground">{t("notifyAnnouncementDesc")}</p>
|
|
</div>
|
|
<Switch
|
|
id="notify-announcement"
|
|
name="notifyAnnouncement"
|
|
checked={values.notifyAnnouncement}
|
|
onCheckedChange={(v) => onChange("notifyAnnouncement", v)}
|
|
/>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
)
|
|
}
|