Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/frontend/packages/swarm-ui/src/ui/disclosure/DisclosureAction.tsx
iris bf7345405f swarm-ui: the refresh picker of a polling card sits in the card's header row
On the jobs, builds and hives cards the picker was alone on the first line of
the body. DisclosureAction puts a body's control in the header of the
disclosure it is in, beside the chevron and outside the toggle, so it costs no
row and pressing it does not fold the card.
2026-11-07 09:22:34 +01:00

16 lines
714 B
TypeScript

// <DisclosureAction> — a control for the header row of the disclosure it is in:
// the refresh picker of a card that polls. The body owns the control's state, so
// a body renders it where it needs the state, and it shows in the header, beside
// the chevron, instead of taking a row of the body. It is a sibling of the
// header's toggle, not inside it, so pressing it does not fold the card. A
// disclosure that is shut has no body, so the control is there only while open.
import type { ComponentChildren } from "preact";
import "./DisclosureAction.css";
export function DisclosureAction({
children,
}: {
children: ComponentChildren;
}) {
return <div class="ui-disclosure-action">{children}</div>;
}