Report reply

Pro

Flag a reply for a person to review: why, and an optional note. Who reviews it is the service's policy and is passed in, so the confirmation says where the report actually went. Sent once; the button then shows it was sent.

Markdown

Preview

Install

With the Candor CLI

First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/report-reply

Brings in: button, locale, popover, utils · npm: lucide-react@^1.67.0

Usage

TSX · The example above
"use client"

import { ReportReply } from "@/components/report-reply"

export default function Example() {
  return (
    <div className="flex max-w-lg flex-col gap-2">
      <p className="text-sm">The orders table has no index on customer_id, so I’ve drafted a migration that adds one.</p>
      <ReportReply reviewer="the Keel quality team" onReport={() => {}} />
    </div>
  )
}

<ReportReply>

PropTypeDefaultDescription
reviewerrequiredstring—Who sees the report, e.g. "the quality team".
onReportrequired(reason: ReportReason, note: string) => void | Promise<void>—Called on send with the reason and the trimmed note (empty if none); the send button waits on a returned promise.
classNamestring | undefined—Extra classes for the outer element.

Strings

The fixed words, in English by default. Change any of them under reportReply in <LocaleProvider strings={{ … }}>; the table is exported as reportReplyStrings.

KeyEnglish
wrongIt’s wrong
wrongDetailA fact, number or name doesn’t match reality
unsafeIt proposed something unsafe
unsafeDetailA change that could break or expose something
harmfulIt’s harmful or inappropriate
harmfulDetailOffensive, biased, or shouldn’t have been said
otherSomething else
otherDetailSay what in the note
reportedReported to {reviewer}
reportReport this reply
questionWhat’s wrong with this reply?
noteNote (optional)
goesToGoes to {reviewer}, with this reply and the thread up to it.
sendReport

Types

ReportReason
"wrong" | "unsafe" | "harmful" | "other"