mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-15 12:19:17 +00:00
Enhance JSONGenerator: improve SelectItem layout with color indicators for better visual representation of alert types
This commit is contained in:
parent
599c2f8b56
commit
8b34879d66
@ -538,15 +538,28 @@ export default function JSONGenerator() {
|
|||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
value={note.type}
|
value={note.type}
|
||||||
onValueChange={(value: string) => updateNote(index, "type", value)}
|
onValueChange={(value: string) =>
|
||||||
|
updateNote(index, "type", value)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<SelectTrigger className="flex-1">
|
<SelectTrigger className="flex-1">
|
||||||
<SelectValue placeholder="Type" />
|
<SelectValue placeholder="Type" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{Object.keys(AlertColors).map((type) => (
|
{Object.keys(AlertColors).map((type) => (
|
||||||
<SelectItem key={type} value={type}>
|
<SelectItem
|
||||||
{type.charAt(0).toUpperCase() + type.slice(1)}
|
key={type}
|
||||||
|
value={type}
|
||||||
|
>
|
||||||
|
<span className="flex items-center gap-2">
|
||||||
|
{type.charAt(0).toUpperCase() + type.slice(1)}{" "}
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
"size-4 rounded-full border",
|
||||||
|
AlertColors[type as keyof typeof AlertColors],
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
|
Loading…
Reference in New Issue
Block a user