feat: replace department text input with preloaded select dropdown

This commit is contained in:
2026-03-07 23:15:15 -06:00
parent 0f31677631
commit d8793000fc

View File

@@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import axios from 'axios'; import axios from 'axios';
import { DEPARTMENTS } from '../data/departments';
const s = { const s = {
overlay: { overlay: {
@@ -133,7 +134,12 @@ export default function EditEmployeeModal({ employee, onClose, onSaved }) {
<div style={s.label}>Full Name</div> <div style={s.label}>Full Name</div>
<input style={s.input} value={name} onChange={e => setName(e.target.value)} /> <input style={s.input} value={name} onChange={e => setName(e.target.value)} />
<div style={s.label}>Department</div> <div style={s.label}>Department</div>
<input style={s.input} value={department} onChange={e => setDepartment(e.target.value)} placeholder="Optional" /> <select style={s.select} value={department} onChange={e => setDepartment(e.target.value)}>
<option value="">-- Select Department --</option>
{DEPARTMENTS.map(d => (
<option key={d} value={d}>{d}</option>
))}
</select>
<div style={s.label}>Supervisor</div> <div style={s.label}>Supervisor</div>
<input style={s.input} value={supervisor} onChange={e => setSupervisor(e.target.value)} placeholder="Optional" /> <input style={s.input} value={supervisor} onChange={e => setSupervisor(e.target.value)} placeholder="Optional" />
<div style={s.row}> <div style={s.row}>