feat: Add ability to configure and test SMTP via UI

This commit is contained in:
Maksim Eltyshev
2025-09-22 20:35:13 +02:00
parent 3a12bb7457
commit c6f4dcdb70
114 changed files with 2161 additions and 301 deletions
+3 -1
View File
@@ -5,13 +5,15 @@
import { useCallback, useState } from 'react';
const CHECKED_TYPES_SET = new Set(['checkbox', 'radio']);
export default (initialData) => {
const [data, setData] = useState(initialData);
const handleFieldChange = useCallback((_, { type, name: fieldName, value, checked }) => {
setData((prevData) => ({
...prevData,
[fieldName]: type === 'radio' ? checked : value,
[fieldName]: CHECKED_TYPES_SET.has(type) ? checked : value,
}));
}, []);