Skip to content

Commit

Permalink
style: add clear all button to timeslots page
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbenincasa committed Nov 8, 2024
1 parent 0f5b437 commit 0bae6e6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions web/src/pages/channels/TimeSlotEditorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useChannelEditor } from '@/store/selectors.ts';
import {
ArrowBack,
Autorenew,
ClearAll,
ExpandLess,
ExpandMore,
} from '@mui/icons-material';
Expand Down Expand Up @@ -392,6 +393,15 @@ export default function TimeSlotEditorPage() {
Time Slots
</Typography>
<AddTimeSlotButton control={control} setValue={setValue} />
{!isEmpty(currentSlots) && (
<Button
onClick={() => setValue('slots', [], { shouldDirty: true })}
sx={{ ml: 1 }}
startIcon={<ClearAll />}
>
Clear All
</Button>
)}
</Stack>
<Divider sx={{ my: 2 }} />
{renderTimeSlots()}
Expand Down

0 comments on commit 0bae6e6

Please sign in to comment.