import type { ReactNode } from "react"; import { IconEye, IconEyeOff } from "@tabler/icons-react"; import { setCardHidden, useDashboardLayout } from "../utils/dashboardLayout"; import { t } from "../i18n"; /** Whether the person has hidden a dashboard card, whether they are arranging the dashboard, and so whether the card is to be drawn (hidden ones are drawn, dimmed, while arranging). */ export function useCardState(label: string): { hidden: boolean; editing: boolean; shown: boolean } { const { layout, editing } = useDashboardLayout(); const hidden = layout.hidden.includes(label); return { hidden, editing, shown: !hidden || editing }; } /** The bar above a card while the dashboard is being arranged: its name and a button to hide it or bring it back. */ export function HideBar({ label, hidden }: { label: string; hidden: boolean }) { return (