mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-20 18:11:00 +00:00
feat: replace notification checkboxes with card-based layout (#5421)
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
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user