Let StatusDot accept a custom label and align with the Badge palette
Description
src/components/StatusDot.tsx hard-codes its three labels ("Operational", "Degraded", "Down") and offers no way to override the text, so the admin page cannot show, say, "Paused" using the same dot affordance — it would have to render a separate element. The component also re-declares colour values that overlap conceptually with Badge's variants. This issue adds an optional label override (defaulting to the existing text) so the dot is reusable beyond the three fixed states, keeping the colour-coded dot intact.
Requirements and context
- Repository scope: Agentpay-Org/Agentpay-frontend only.
- Add an optional
label?: ReactNode prop that overrides the default per-variant text; keep the existing defaults when omitted.
- Keep the
aria-hidden colour dot plus the visible text label so meaning is not conveyed by colour alone.
- Preserve the existing
variant union (ok | warn | down) and the public shape for current callers (admin/stats).
- Do not change the rendered DOM structure for existing call sites that omit
label.
Suggested execution
- Fork the repo and create a branch
git checkout -b enhancement/components-statusdot-custom-label
- Implement changes
- Write code in:
src/components/StatusDot.tsx.
- Write comprehensive tests in: create
src/components/__tests__/StatusDot.test.tsx — assert default labels per variant, a custom label overrides, and the dot is aria-hidden.
- Add documentation: add a JSDoc block documenting the variants and the label override.
- Validate the text label is always present for screen readers.
- Test and commit
Test and commit
- Run
npm run lint, npm run typecheck, npm test, and npm run build.
- Cover edge cases: each variant default, a custom label, and an empty-string label fallback.
- Include the
npm test output.
Example commit message
feat(components): add optional custom label to StatusDot
Guidelines
- Minimum 95 percent test coverage for the component.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
Community & contribution rewards
- 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
- ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.
Let StatusDot accept a custom label and align with the Badge palette
Description
src/components/StatusDot.tsxhard-codes its three labels ("Operational", "Degraded", "Down") and offers no way to override the text, so the admin page cannot show, say, "Paused" using the same dot affordance — it would have to render a separate element. The component also re-declares colour values that overlap conceptually withBadge's variants. This issue adds an optionallabeloverride (defaulting to the existing text) so the dot is reusable beyond the three fixed states, keeping the colour-coded dot intact.Requirements and context
label?: ReactNodeprop that overrides the default per-variant text; keep the existing defaults when omitted.aria-hiddencolour dot plus the visible text label so meaning is not conveyed by colour alone.variantunion (ok | warn | down) and the public shape for current callers (admin/stats).label.Suggested execution
git checkout -b enhancement/components-statusdot-custom-labelsrc/components/StatusDot.tsx.src/components/__tests__/StatusDot.test.tsx— assert default labels per variant, a custom label overrides, and the dot isaria-hidden.Test and commit
npm run lint,npm run typecheck,npm test, andnpm run build.npm testoutput.Example commit message
feat(components): add optional custom label to StatusDotGuidelines
Community & contribution rewards