(props: {
kind: 'static-only' | 'runtime-only';
title: string;
note: string;
edges: readonly BugPathEdge[];
onHop: (hop: BugPathNode) => void;
})
| 174 | } |
| 175 | |
| 176 | function Edges(props: { |
| 177 | kind: 'static-only' | 'runtime-only'; |
| 178 | title: string; |
| 179 | note: string; |
| 180 | edges: readonly BugPathEdge[]; |
| 181 | onHop: (hop: BugPathNode) => void; |
| 182 | }): JSX.Element { |
| 183 | return ( |
| 184 | <div |
| 185 | className={`atlas-bugwizard-edges atlas-bugwizard-${props.kind}`} |
| 186 | data-testid={`atlas-bugwizard-${props.kind}`} |
| 187 | data-count={props.edges.length} |
| 188 | > |
| 189 | <span className="atlas-bugwizard-eyebrow">{props.title}</span> |
| 190 | <p className="atlas-bugwizard-note">{props.note}</p> |
| 191 | <ul> |
| 192 | {props.edges.map((edge, index) => ( |
| 193 | <li |
| 194 | key={`${index}:${edge.from.name}:${edge.to.name}`} |
| 195 | className="atlas-bugwizard-edge" |
| 196 | data-testid="atlas-bugwizard-edge" |
| 197 | data-kind={props.kind} |
| 198 | data-from={edge.from.name} |
| 199 | data-to={edge.to.name} |
| 200 | aria-label={bugWizardEdgeLabel(edge.from.name, edge.to.name)} |
| 201 | > |
| 202 | <Hint name="bug-edge-from" text={bugWizardHopTooltip(edge.from.name)}> |
| 203 | <button |
| 204 | type="button" |
| 205 | className="atlas-bugwizard-link" |
| 206 | data-testid="atlas-bugwizard-edge-from" |
| 207 | data-name={edge.from.name} |
| 208 | onClick={() => props.onHop(edge.from)} |
| 209 | > |
| 210 | {edge.from.name} |
| 211 | </button> |
| 212 | </Hint> |
| 213 | <span className="atlas-bugwizard-edge-verb">{BUG_WIZARD_EDGE_VERB}</span> |
| 214 | <Hint name="bug-edge-to" text={bugWizardHopTooltip(edge.to.name)}> |
| 215 | <button |
| 216 | type="button" |
| 217 | className="atlas-bugwizard-link" |
| 218 | data-testid="atlas-bugwizard-edge-to" |
| 219 | data-name={edge.to.name} |
| 220 | onClick={() => props.onHop(edge.to)} |
| 221 | > |
| 222 | {edge.to.name} |
| 223 | </button> |
| 224 | </Hint> |
| 225 | {edge.observed !== undefined && ( |
| 226 | <span className="atlas-bugwizard-observed"> |
| 227 | {bugWizardObservedCount(edge.observed.count, edge.observed.label)} |
| 228 | </span> |
| 229 | )} |
| 230 | {props.kind === 'runtime-only' && ( |
| 231 | <span className="atlas-bugwizard-verdict" data-testid="atlas-bugwizard-edge-verdict"> |
| 232 | {edgeVerdict(edge)} |
| 233 | </span> |
nothing calls this directly
no test coverage detected