Skip to main content

EditQuestionButton

packages/engagement/components/molecules/EditQuestionButton.js · Tier: molecule · Module: engagement · Rendering: Client Component ('use client')

Purpose​

Renders the "Edit consultation" button and conditionally mounts the EditQuestionModal. Kept as a separate client component so the parent page can stay a server component. It only renders for future consultations (the parent controls the visibility condition).

Props​

PropTypeRequiredDefaultDescription
questionobjectyes—The consultation to edit.
tobjectyes—Localized copy (forwarded to the modal).
langstringno—Locale (per the JSDoc signature).

Composition​

  • Uses: atoms/core/Icon, molecules/engagement/EditQuestionModal, useState.
  • Used by: organisms/engagement/QuestionDetailView (future consultations).

Internationalisation​

t.buttonLabel (and the modal copy) supplied by the caller.

Accessibility​

A labelled button that mounts the accessible EditQuestionModal on demand.

molecules/engagement/EditQuestionModal, organisms/engagement/QuestionDetailView.