({
onExit,
setAnalysisMode,
analysisMode,
}: HeaderProps)
| 207 | } |
| 208 | |
| 209 | const Header: FC<HeaderProps> = ({ |
| 210 | onExit, |
| 211 | setAnalysisMode, |
| 212 | analysisMode, |
| 213 | }: HeaderProps) => { |
| 214 | // Extract analysisData from context |
| 215 | const { deleteNodes } = useContext(GraphContext); |
| 216 | const { analysisData, address } = useContext(AnalysisContext); |
| 217 | |
| 218 | // When minimized, the address hash should be sliced off |
| 219 | const displayedAddress = |
| 220 | address.slice(0, analysisData?.labels.length ? 4 : 8) + |
| 221 | ".." + |
| 222 | address.slice(-2); |
| 223 | const risk = analysisData!.risk; |
| 224 | |
| 225 | return ( |
| 226 | <span className="flex cursor-move flex-row items-center justify-between gap-x-2"> |
| 227 | <span className="flex flex-row items-center space-x-2"> |
| 228 | {/* Address Risk inside a badge */} |
| 229 | <RiskIndicator risk={risk} isLoading={false} /> |
| 230 | |
| 231 | {/* Address information */} |
| 232 | <div className="flex flex-col gap-y-0.5"> |
| 233 | <span className="flex flex-row items-center gap-x-1 gap-y-1"> |
| 234 | {/* Address Hash - Sliced when in non-expanded mode*/} |
| 235 | <h1 className="font-xs flex flex-row gap-1 font-semibold tracking-tight text-gray-800"> |
| 236 | {analysisData?.labels.length && analysisData.labels[0]} |
| 237 | <span className="mt-[0.1rem] font-mono font-normal"> |
| 238 | {analysisData?.labels.length && "("} |
| 239 | {displayedAddress} |
| 240 | {analysisData?.labels.length && ")"} |
| 241 | </span> |
| 242 | |
| 243 | <EntityLogo |
| 244 | entity={analysisData!.labels[0]} |
| 245 | className="h-7 w-7 rounded-full" |
| 246 | /> |
| 247 | </h1> |
| 248 | |
| 249 | {/* Clipboard and Block Explorer icons - only shown in expanded mode */} |
| 250 | <CopyToClipboardIcon textToCopy={address} /> |
| 251 | {analysisData && ( |
| 252 | <BlockExplorerAddressIcon |
| 253 | blockchain={analysisData.blockchain} |
| 254 | address={address} |
| 255 | /> |
| 256 | )} |
| 257 | </span> |
| 258 | <span className="flex flex-row items-center justify-start gap-x-1.5"> |
| 259 | {/* List of labels using Badges shown underneath the address. */} |
| 260 | <LabelsAndTagsWithAuth /> |
| 261 | </span> |
| 262 | </div> |
| 263 | </span> |
| 264 | |
| 265 | {/* Exit button */} |
| 266 | <span className="flex flex-row items-center gap-x-1.5"> |
nothing calls this directly
no outgoing calls
no test coverage detected