One card, as the fold shows it.
(props: { card: Card; onOpen: (source: CardSource) => void })
| 159 | |
| 160 | /** One card, as the fold shows it. */ |
| 161 | function CardRow(props: { card: Card; onOpen: (source: CardSource) => void }): JSX.Element { |
| 162 | const { card } = props; |
| 163 | const source = card.source; |
| 164 | return ( |
| 165 | <li className="atlas-chat-card" data-testid="atlas-chat-card" data-card={card.id} data-kind={card.kind}> |
| 166 | <span className="atlas-chat-card-id">{card.id}</span> |
| 167 | <span className="atlas-chat-card-lines"> |
| 168 | {card.lines.map((line, index) => ( |
| 169 | <span className="atlas-chat-card-line" key={`${card.id}-${index}`}> |
| 170 | {line} |
| 171 | </span> |
| 172 | ))} |
| 173 | </span> |
| 174 | {source !== undefined && source.filePath !== undefined && ( |
| 175 | <Hint name="chat-card-open" text={messages.chat.openCard(source.filePath, source.line)}> |
| 176 | <button |
| 177 | type="button" |
| 178 | className="atlas-chat-card-open" |
| 179 | data-testid="atlas-chat-card-open" |
| 180 | onClick={() => props.onOpen(source)} |
| 181 | > |
| 182 | {source.filePath} |
| 183 | {source.line === undefined ? '' : `:${source.line}`} |
| 184 | </button> |
| 185 | </Hint> |
| 186 | )} |
| 187 | </li> |
| 188 | ); |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * The candidates of an ambiguous name, as a list to choose from. |
nothing calls this directly
no outgoing calls
no test coverage detected