import * as React from "react" ; import { HollowGreenCheck , HollowRedNoGood } from "../icons" ; import { ListingSummaryComponentProps } from "./types" ; import { StyledBaseResultsBanner , StyledRejectedResultsBanner } from "./styledComponents" ; const ChallengeResultsBanner = props => { const { appeal , didChallengeOriginallySucceed , canBeWhitelisted } = props ; let decisionText = null ; if ( appeal && appeal . appealGranted ) { if ( didChallengeOriginallySucceed ) { decisionText = ( < StyledBaseResultsBanner > < HollowGreenCheck /> Appeal granted to accept Newsroom < /StyledBaseResultsBanner>); } else { decisionText = ( < StyledRejectedResultsBanner > < HollowRedNoGood /> Appeal granted to reject Newsroom < /StyledRejectedResultsBanner>); } } else if ( didChallengeOriginallySucceed ) { decisionText = ( < StyledRejectedResultsBanner > < HollowRedNoGood /> Community voted to reject Newsroom < /StyledRejectedResultsBanner>); } else if ( canBeWhitelisted ) { decisionText = ( < StyledBaseResultsBanner > < HollowGreenCheck /> Newsroom application passed without challenge < /StyledBaseResultsBanner>); } else if ( ! didChallengeOriginallySucceed ) { decisionText = ( < StyledBaseResultsBanner > < HollowGreenCheck /> Community voted to accept Newsroom < /StyledBaseResultsBanner>); } return decisionText ; } ; export default ChallengeResultsBanner ;