checkboxes

This commit is contained in:
Alex Holliday committed 2025-11-24 18:54:52 +00:00
1 parent e4d6e0930f
commit 9be77a547d
2 files changed
+14 -8

No files matched your search

+5 -4
View File
@@ -8,7 +8,10 @@ type CheckboxInputProps = CheckboxProps & {
label?: string; label?: string;
}; };
export const CheckboxInput = forwardRef<HTMLInputElement, CheckboxInputProps>( export const CheckboxInput = forwardRef<HTMLInputElement, CheckboxInputProps>(
function CheckboxInput({ sx, ...props }: CheckboxInputProps, ref: React.Ref<HTMLInputElement>) { function CheckboxInput(
{ sx, ...props }: CheckboxInputProps,
ref: React.Ref<HTMLInputElement>
) {
const theme = useTheme(); const theme = useTheme();
return ( return (
<Checkbox <Checkbox
@@ -35,9 +38,7 @@ export const CheckboxInput = forwardRef<HTMLInputElement, CheckboxInputProps>(
stroke: "currentColor", stroke: "currentColor",
fill: "none", fill: "none",
}, },
"&.Mui-checked svg rect": {
fill: theme.palette.accent.main,
},
...sx, ...sx,
}} }}
/> />
@@ -11,6 +11,7 @@ import {
type UptimeMonitorType, type UptimeMonitorType,
type MonitorStatus, type MonitorStatus,
} from "@/types/monitor"; } from "@/types/monitor";
import { ThemeContext } from "@emotion/react";
type HeaderFilterProps = { type HeaderFilterProps = {
selectedTypes: UptimeMonitorType[]; selectedTypes: UptimeMonitorType[];
@@ -53,8 +54,10 @@ export const HeaderFilter = ({
> >
{UptimeMonitorTypes.map((type) => ( {UptimeMonitorTypes.map((type) => (
<MenuItem key={type} value={type}> <MenuItem key={type} value={type}>
<Checkbox checked={selectedTypes.includes(type)} /> <Stack direction={"row"} gap={theme.spacing(2)}>
<Typography textTransform={"capitalize"}>{type}</Typography> <Checkbox checked={selectedTypes.includes(type)} />
<Typography textTransform={"capitalize"}>{type}</Typography>
</Stack>
</MenuItem> </MenuItem>
))} ))}
</Select> </Select>
@@ -67,8 +70,10 @@ export const HeaderFilter = ({
> >
{MonitorStatuses.map((status) => ( {MonitorStatuses.map((status) => (
<MenuItem key={status} value={status}> <MenuItem key={status} value={status}>
<Checkbox checked={selectedStatuses.includes(status)} /> <Stack direction={"row"} gap={theme.spacing(2)}>
<Typography textTransform={"capitalize"}>{status}</Typography> <Checkbox checked={selectedStatuses.includes(status)} />
<Typography textTransform={"capitalize"}>{status}</Typography>
</Stack>
</MenuItem> </MenuItem>
))} ))}
</Select> </Select>