The Work Schedule Organizer lets you add employees directly from the browser without editing any files. Clicking the Add Employee button reveals an inline form. Once you fill in the required fields and submit, the new employee is inserted into the list in alphabetical order and the form closes automatically.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/y-broad/workschedule/llms.txt
Use this file to discover all available pages before exploring further.
Opening and closing the form
The Add Employee button sits at the top of the app. Clicking it toggles a boolean in React state (showingAddEmployee). When the state is true, the AddEmployee component renders below the button. Clicking Cancel — or successfully submitting the form — sets the state back to false and hides the form.
Form fields
| Field | Type | Required | Description |
|---|---|---|---|
| Name | text | Yes | The employee’s full display name |
| Phone | text | Yes | Contact phone number (any format) |
| Yes | Contact email address, validated by the browser | ||
| Monday | checkbox | No | Include Monday as a workday |
| Tuesday | checkbox | No | Include Tuesday as a workday |
| Wednesday | checkbox | No | Include Wednesday as a workday |
| Thursday | checkbox | No | Include Thursday as a workday |
| Friday | checkbox | No | Include Friday as a workday |
How the form works
TheAddEmployee component (src/addEmployee.jsx) holds all field values in a single state object. Text inputs are handled by handleInputChange, which spreads the existing state and overwrites the changed key. Workday checkboxes are handled by handleCheckboxChange, which does the same inside the nested workdays object.
handleSubmit prevents the default form behaviour and passes the assembled employee object up to App.jsx via the addEmployee prop:
App.jsx then merges the new employee into the existing array, re-sorts the entire list with localeCompare, updates state, and sets showingAddEmployee to false — closing the form.
Step-by-step
Enter contact details
Fill in the Name, Phone, and Email fields. All three are required — the browser will block submission if any are empty or if the email is malformed.
Select workdays
Check any combination of Monday through Friday to mark the employee’s schedule. All days default to unchecked.
Employees added through the form exist only in React state for the current browser session. They are not written back to
public/employees.json, so they will disappear on the next page load or refresh.