11import React from "react" ;
22import styled from "styled-components" ;
33import { Periods } from "consts/periods" ;
4- import LawBalanceIcon from "svgs/icons/law-balance.svg" ;
54import BookmarkIcon from "svgs/icons/bookmark.svg" ;
6- import PileCoinsIcon from "svgs/icons/pile-coins.svg" ;
75import CalendarIcon from "svgs/icons/calendar.svg" ;
6+ import LawBalanceIcon from "svgs/icons/law-balance.svg" ;
7+ import PileCoinsIcon from "svgs/icons/pile-coins.svg" ;
88import Field from "../Field" ;
99
1010const Container = styled . div `
@@ -13,7 +13,7 @@ const Container = styled.div`
1313 gap: 8px;
1414` ;
1515
16- const getPeriodPhrase = ( period : Periods ) => {
16+ const getPeriodPhrase = ( period : Periods ) : string => {
1717 switch ( period ) {
1818 case Periods . evidence :
1919 return "Voting Starts" ;
@@ -35,36 +35,14 @@ export interface IDisputeInfo {
3535 date ?: number ;
3636}
3737
38- const DisputeInfo : React . FC < IDisputeInfo > = ( {
39- courtId,
40- court,
41- category,
42- rewards,
43- period,
44- date,
45- } ) => {
38+ const DisputeInfo : React . FC < IDisputeInfo > = ( { courtId, court, category, rewards, period, date } ) => {
4639 return (
4740 < Container >
48- { category && (
49- < Field icon = { BookmarkIcon } name = "Category" value = { category } />
50- ) }
51- { court && courtId && (
52- < Field
53- icon = { LawBalanceIcon }
54- name = "Court"
55- value = { court }
56- link = { `/courts/${ courtId } ` }
57- />
58- ) }
59- { rewards && (
60- < Field icon = { PileCoinsIcon } name = "Juror Rewards" value = { rewards } />
61- ) }
41+ { category && < Field icon = { BookmarkIcon } name = "Category" value = { category } /> }
42+ { court && courtId && < Field icon = { LawBalanceIcon } name = "Court" value = { court } link = { `/courts/${ courtId } ` } /> }
43+ { rewards && < Field icon = { PileCoinsIcon } name = "Juror Rewards" value = { rewards } /> }
6244 { typeof period !== "undefined" && date && (
63- < Field
64- icon = { CalendarIcon }
65- name = { getPeriodPhrase ( period ) }
66- value = { new Date ( date * 1000 ) . toLocaleString ( ) }
67- />
45+ < Field icon = { CalendarIcon } name = { getPeriodPhrase ( period ) } value = { new Date ( date * 1000 ) . toLocaleString ( ) } />
6846 ) }
6947 </ Container >
7048 ) ;
0 commit comments