Skip to content

Commit

Permalink
Improve invalid election card
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Aug 22, 2024
1 parent 4c3efa6 commit 5390fa9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/components/Process/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ElectionCardSkeleton = (rest: CardProps) => {

if (!election) return null
if (election instanceof InvalidElectionType) {
return <InvalidElection />
return <InvalidElectionCard election={election} {...rest} />
}

return (
Expand Down Expand Up @@ -68,3 +68,19 @@ const ElectionCardSkeleton = (rest: CardProps) => {
</LinkCard>
)
}

const InvalidElectionCard = ({ election, ...rest }: { election: InvalidElectionType } & CardProps) => {
return (
<LinkCard
direction={'row'}
alignItems='center'
pl={4}
to={generatePath(RoutePath.Process, { pid: election.id, tab: null })}
{...rest}
>
<CardBody>
<InvalidElection />
</CardBody>
</LinkCard>
)
}

0 comments on commit 5390fa9

Please sign in to comment.