(null)
+ const [copied, setCopied] = useState(false)
// Poll so reviewers see each other's comments without a realtime transport.
useEffect(() => {
@@ -91,6 +124,16 @@ export function PlanReview({ plan }: { plan: PlanData }) {
[plan.threadId]
)
+ const copyPlan = useCallback(async () => {
+ setError(null)
+ if (await copyToClipboard(plan.markdown)) {
+ setCopied(true)
+ window.setTimeout(() => setCopied(false), 1500)
+ } else {
+ setError("Couldn't copy the plan to the clipboard.")
+ }
+ }, [plan.markdown])
+
return (
)}
+
{plan.isOwner && (