Stelle Website-Projekte und Admin-Tabs nach Auto-Deploy-Reset wieder her.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -30,6 +30,7 @@ export default function AdminPage() {
|
||||
const [customerForm, setCustomerForm] = useState({ code: '', name: '', location: '', email: '', phone: '' })
|
||||
const [editingEmployee, setEditingEmployee] = useState(null)
|
||||
const [employeeForm, setEmployeeForm] = useState({ userId: '', displayName: '', email: '', shortcode: '' })
|
||||
const [adminSection, setAdminSection] = useState('config')
|
||||
|
||||
// Update localConfig when config loads
|
||||
useEffect(() => {
|
||||
@@ -122,6 +123,40 @@ export default function AdminPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div
|
||||
className="text-center mb-2"
|
||||
style={{
|
||||
display: 'flex',
|
||||
gap: '20px',
|
||||
justifyContent: 'center',
|
||||
flexWrap: 'wrap',
|
||||
padding: '12px',
|
||||
background: 'rgba(45, 55, 72, 0.4)',
|
||||
borderRadius: '8px',
|
||||
}}
|
||||
>
|
||||
{[
|
||||
{ id: 'config', label: 'Konfiguration' },
|
||||
{ id: 'customers', label: 'Kunden' },
|
||||
{ id: 'employees', label: 'Mitarbeiter' },
|
||||
].map((section) => (
|
||||
<label
|
||||
key={section.id}
|
||||
style={{ display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer', fontWeight: adminSection === section.id ? 'bold' : 'normal' }}
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name="adminSection"
|
||||
checked={adminSection === section.id}
|
||||
onChange={() => setAdminSection(section.id)}
|
||||
/>
|
||||
{section.label}
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{adminSection === 'config' && (
|
||||
<>
|
||||
<div className="row">
|
||||
{/* Ticket Types */}
|
||||
<div className="col col-6">
|
||||
@@ -308,10 +343,31 @@ export default function AdminPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Customers */}
|
||||
<div className="text-center mt-2">
|
||||
<button
|
||||
className="btn btn-dark"
|
||||
onClick={handleSave}
|
||||
disabled={saving}
|
||||
style={{ minWidth: '200px' }}
|
||||
>
|
||||
{saving ? (
|
||||
<>
|
||||
<FaSpinner className="spinner" /> Speichere...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<FaFloppyDisk /> Konfiguration speichern
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{adminSection === 'customers' && (
|
||||
<div className="card mb-2">
|
||||
<div className="card-header">
|
||||
<h3>Customers</h3>
|
||||
<h3>Kunden</h3>
|
||||
</div>
|
||||
<div className="card-body">
|
||||
{customersLoading ? (
|
||||
@@ -537,8 +593,9 @@ export default function AdminPage() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Employees */}
|
||||
{adminSection === 'employees' && (
|
||||
<div className="card mb-2">
|
||||
<div className="card-header">
|
||||
<h3>Mitarbeiter & Kürzel</h3>
|
||||
@@ -673,25 +730,8 @@ export default function AdminPage() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="text-center mt-2">
|
||||
<button
|
||||
className="btn btn-dark"
|
||||
onClick={handleSave}
|
||||
disabled={saving}
|
||||
style={{ minWidth: '200px' }}
|
||||
>
|
||||
{saving ? (
|
||||
<>
|
||||
<FaSpinner className="spinner" /> Speichere...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<FaFloppyDisk /> Konfiguration speichern
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user