mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-05 10:14:44 +03:00
55d08d2ae9
Replace EventBusCheckboxes with card-based notification settings: - Each event group gets its own card with responsive grid layout - Master checkbox per group with indeterminate state - Inline parameter inputs (CPU threshold) appear when enabled - Theme-adaptive via Ant Design Card component Components: - NotificationLayout, NotificationCard, NotificationHeader, NotificationEvent - TelegramNotifications, EmailNotifications with explicit event configs
27 lines
609 B
TypeScript
27 lines
609 B
TypeScript
import type { ReactNode } from 'react';
|
|
import { Checkbox } from 'antd';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
interface Props {
|
|
label: string;
|
|
checked: boolean;
|
|
onToggle: () => void;
|
|
children?: ReactNode;
|
|
}
|
|
|
|
export function NotificationEvent({ label, checked, onToggle, children }: Props) {
|
|
const { t } = useTranslation();
|
|
return (
|
|
<div>
|
|
<Checkbox checked={checked} onChange={onToggle}>
|
|
{t(label)}
|
|
</Checkbox>
|
|
{checked && children && (
|
|
<div style={{ paddingLeft: 24, marginTop: 4 }}>
|
|
{children}
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|