'use client'; import { useState } from 'react'; interface OrganizationCreateModalProps { isOpen: boolean; onClose: () => void; onCreate?: (organization: { name: string; type: string; address?: string; contact?: string; email?: string; phone?: string; }) => void; } export default function OrganizationCreateModal({ isOpen, onClose, onCreate }: OrganizationCreateModalProps) { const [formData, setFormData] = useState({ name: '', type: 'Авиакомпания', address: '', contact: '', email: '', phone: '', }); if (!isOpen) return null; const handleChange = (field: string, value: string) => { setFormData({ ...formData, [field]: value }); }; const handleSubmit = () => { if (!formData.name) { alert('Пожалуйста, укажите название организации'); return; } if (onCreate) { onCreate(formData); setFormData({ name: '', type: 'Авиакомпания', address: '', contact: '', email: '', phone: '', }); onClose(); } }; return (
e.stopPropagation()} >

Добавление организации

handleChange('name', e.target.value)} style={{ width: '100%', padding: '12px', border: '1px solid #ccc', borderRadius: '4px', fontSize: '14px', }} placeholder="Введите название организации" />
handleChange('address', e.target.value)} style={{ width: '100%', padding: '12px', border: '1px solid #ccc', borderRadius: '4px', fontSize: '14px', }} placeholder="Введите адрес организации" />
handleChange('contact', e.target.value)} style={{ width: '100%', padding: '12px', border: '1px solid #ccc', borderRadius: '4px', fontSize: '14px', }} placeholder="Введите ФИО контактного лица" />
handleChange('email', e.target.value)} style={{ width: '100%', padding: '12px', border: '1px solid #ccc', borderRadius: '4px', fontSize: '14px', }} placeholder="email@example.com" />
handleChange('phone', e.target.value)} style={{ width: '100%', padding: '12px', border: '1px solid #ccc', borderRadius: '4px', fontSize: '14px', }} placeholder="+7 (XXX) XXX-XX-XX" />
); }