@@ -3,6 +3,7 @@ import styled, { css } from "styled-components";
33
44import { useParams } from "react-router-dom" ;
55import { useDebounce } from "react-use" ;
6+ import { Address } from "viem" ;
67
78import { Button } from "@kleros/ui-components-library" ;
89
@@ -11,6 +12,9 @@ import DownArrow from "svgs/icons/arrow-down.svg";
1112import { useSpamEvidence } from "hooks/useSpamEvidence" ;
1213
1314import { useEvidences } from "queries/useEvidences" ;
15+ import { usePopulatedDisputeData } from "queries/usePopulatedDisputeData" ;
16+
17+ import { isUndefined } from "src/utils" ;
1418
1519import { landscapeStyle } from "styles/landscapeStyle" ;
1620
@@ -41,6 +45,10 @@ const StyledLabel = styled.label`
4145 font-size: 16px;
4246` ;
4347
48+ const ArbitrableEvidenceHeading = styled . h2 `
49+ font-weight: 600;
50+ font-size: 24px;
51+ ` ;
4452const ScrollButton = styled ( Button ) `
4553 align-self: flex-end;
4654 background-color: transparent;
@@ -77,14 +85,17 @@ const SpamLabel = styled.label`
7785 cursor: pointer;
7886` ;
7987
80- const Evidence : React . FC = ( ) => {
88+ interface IEvidence {
89+ arbitrable ?: Address ;
90+ }
91+ const Evidence : React . FC < IEvidence > = ( { arbitrable } ) => {
8192 const { id } = useParams ( ) ;
8293 const ref = useRef < HTMLDivElement > ( null ) ;
8394 const [ search , setSearch ] = useState < string > ( ) ;
8495 const [ debouncedSearch , setDebouncedSearch ] = useState < string > ( ) ;
8596 const [ showSpam , setShowSpam ] = useState ( false ) ;
8697 const { data : spamEvidences } = useSpamEvidence ( id ! ) ;
87-
98+ const { data : disputeData } = usePopulatedDisputeData ( id , arbitrable ) ;
8899 const { data } = useEvidences ( id ! , debouncedSearch ) ;
89100
90101 useDebounce ( ( ) => setDebouncedSearch ( search ) , 500 , [ search ] ) ;
@@ -105,6 +116,7 @@ const Evidence: React.FC = () => {
105116 [ spamEvidences ]
106117 ) ;
107118
119+ const arbitrableEvidences = disputeData ?. extraEvidences ;
108120 const evidences = useMemo ( ( ) => {
109121 if ( ! data ?. evidences ) return ;
110122 const spamEvidences = data . evidences . filter ( ( evidence ) => isSpam ( evidence . id ) ) ;
@@ -116,6 +128,19 @@ const Evidence: React.FC = () => {
116128 < Container ref = { ref } >
117129 < EvidenceSearch { ...{ search, setSearch } } />
118130 < ScrollButton small Icon = { DownArrow } text = "Scroll to latest" onClick = { scrollToLatest } />
131+ { ! isUndefined ( arbitrableEvidences ) && arbitrableEvidences . length > 0 ? (
132+ < >
133+ < ArbitrableEvidenceHeading > Evidence provided by arbitrable</ ArbitrableEvidenceHeading >
134+ { arbitrableEvidences . map ( ( { name, description, fileURI, sender, timestamp, transactionHash } , index ) => (
135+ < EvidenceCard
136+ key = { index }
137+ evidence = ""
138+ { ...{ sender, timestamp, transactionHash, name, description, fileURI } }
139+ />
140+ ) ) }
141+ < Divider />
142+ </ >
143+ ) : null }
119144 { evidences ?. realEvidences ? (
120145 < >
121146 { evidences ?. realEvidences . map (
0 commit comments