Skip to content
Myr

annotation.tsx

This file

Path

apps/web/src/features/finish/annotation.tsx

72 lines · 2.2 KiB · TypeScript

Last changed by

Merge build/comments-web-features into mainoscabrielbefore adoption74bfc72

History of this file

Take it

Merge build/1224-decider-pagesoscabrielbefore adoptiond22b7a2

lines 1–72why, one step back
1import type { Refusal } from "@repo/protocol/refusal";
2import { explain } from "@repo/protocol/render";3import { Hourglass, OctagonX, RotateCcw } from "lucide-react";45export interface PlacedRefusal {6 readonly refusal: Refusal;7 readonly path: string;8 readonly line: number;9 readonly round: number;10}1112export const RefusalNote = ({ placed }: { readonly placed: PlacedRefusal }) => {13 const [first = "", ...rest] = explain([placed.refusal]).filter(14 (line) => !line.startsWith(" at: ")15 );1617 const prefix = `${placed.refusal._tag}:`;18 const Mark = placed.refusal.retryable ? RotateCcw : OctagonX;1920 return (21 <div22 className="border-y-refused/40 bg-background flex items-start gap-2 border-y px-4 py-2 font-sans"23 data-refusal={placed.refusal._tag}24 data-retryable={placed.refusal.retryable}25 >26 <Mark27 aria-hidden="true"28 className={`mt-0.5 size-3.5 shrink-0 ${placed.refusal.retryable ? "text-waiting" : "text-refused"}`}29 strokeWidth={1.75}30 />31 <div className="flex min-w-0 flex-col gap-0.5">32 <p className="text-label text-muted-foreground font-normal">33 Refused here in round {placed.round}34 </p>35 <samp className="text-mono leading-terminal block font-mono [overflow-wrap:anywhere] whitespace-pre-wrap">36 <span className="block">37 <b className="text-refused font-semibold">{prefix}</b>38 {first.slice(prefix.length)}39 </span>40 {rest.map((line) => (41 <span className="text-muted-foreground block" key={line}>42 {line}43 </span>44 ))}45 </samp>46 </div>47 </div>48 );49};5051export const MarkerNote = ({52 marker,53 reason,54}: {55 readonly marker: string;56 readonly reason: string;57}) => (58 <div59 className="border-y-waiting/40 bg-background flex items-start gap-2 border-y px-4 py-2 font-sans"60 data-marker={marker}61 >62 <Hourglass63 aria-hidden="true"64 className="text-waiting mt-0.5 size-3.5 shrink-0"65 strokeWidth={1.75}66 />67 <p className="text-ui min-w-0">68 <span className="text-waiting font-medium">Waits on this decision:</span>{" "}69 <code className="text-mono font-mono">{marker}</code>, {reason}70 </p>71 </div>72);