add placeholder
This commit is contained in:
1 parent
94ecaddae2
commit
2319b67d05
6 files changed
+43
-22
No files matched your search
@@ -12,16 +12,6 @@ import {
|
||||
type MonitorStatus,
|
||||
} from "@/types/monitor";
|
||||
|
||||
const formatValue = (value: string[], fallback: string) => {
|
||||
if (value.length === 0) {
|
||||
return fallback;
|
||||
}
|
||||
const capitalized = value.map(
|
||||
(item) => item.charAt(0).toUpperCase() + item.slice(1)
|
||||
);
|
||||
return capitalized.join(" | ");
|
||||
};
|
||||
|
||||
type HeaderFilterProps = {
|
||||
selectedTypes: UptimeMonitorType[];
|
||||
selectedStatuses: MonitorStatus[];
|
||||
@@ -56,12 +46,10 @@ export const HeaderFilter = ({
|
||||
<Stack spacing={theme.spacing(4)} direction={{ xs: "column", sm: "row" }}>
|
||||
<Select
|
||||
fieldLabel="Monitor type"
|
||||
placeholder="Monitor type"
|
||||
multiple
|
||||
value={selectedTypes}
|
||||
onChange={handleTypeChange}
|
||||
renderValue={(selected) => (
|
||||
<Typography>{formatValue(selected, "All Monitor Types")}</Typography>
|
||||
)}
|
||||
>
|
||||
{UptimeMonitorTypes.map((type) => (
|
||||
<MenuItem key={type} value={type}>
|
||||
@@ -72,14 +60,10 @@ export const HeaderFilter = ({
|
||||
</Select>
|
||||
<Select
|
||||
fieldLabel="Monitor status"
|
||||
placeholder="Monitor status"
|
||||
multiple
|
||||
value={selectedStatuses}
|
||||
onChange={handleStatusChange}
|
||||
renderValue={(selected) => (
|
||||
<Typography>
|
||||
{formatValue(selected, "All Monitor Statuses")}
|
||||
</Typography>
|
||||
)}
|
||||
>
|
||||
{MonitorStatuses.map((status) => (
|
||||
<MenuItem key={status} value={status}>
|
||||
|
||||
Reference in new issue
Block a user