Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

497 B
Raw Blame
import { createSignal } from 'solid-js';

export function useAlertGroupExpansion() {
  const [expandedGroups, setExpandedGroups] = createSignal<Set<string>>(new Set());

  const toggleGroup = (key: string) => {
    setExpandedGroups((prev) => {
      const next = new Set(prev);
      if (next.has(key)) next.delete(key);
      else next.add(key);
      return next;
    });
  };

  const isGroupExpanded = (key: string) => expandedGroups().has(key);

  return { isGroupExpanded, toggleGroup };
}