Skip to content

Commit

Permalink
feat(LatestProposalsTable): display message when no proposals are found
Browse files Browse the repository at this point in the history
  • Loading branch information
shenshin committed Nov 20, 2024
1 parent 737bda0 commit 18f8f28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/proposals/LatestProposalsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ProposalNameColumn } from '@/app/proposals/ProposalNameColumn'
import { ReactNode, useMemo, memo, useState } from 'react'
import { TimeRemainingColumn } from '@/app/proposals/TimeRemainingColumn'
import { DebounceSearch } from '../../components/DebounceSearch/DebounceSearch'
import { Typography } from '@/components/Typography'

interface LatestProposalsTableProps {
latestProposals: ReturnType<typeof useFetchAllProposals>['latestProposals']
Expand Down Expand Up @@ -64,7 +65,7 @@ const LatestProposalsTable = ({ latestProposals }: LatestProposalsTableProps) =>
<div>
<HeaderTitle className="mb-4">Latest Proposals</HeaderTitle>
<DebounceSearch placeholder="Search a proposal" onSearchSubmit={onSearchSubmit} />
{latestProposalsMapped.length > 0 && (
{latestProposalsMapped.length > 0 ? (
<SharedProposalsTableContextProvider>
<Table
key={latestProposalsMapped.length}
Expand All @@ -76,6 +77,8 @@ const LatestProposalsTable = ({ latestProposals }: LatestProposalsTableProps) =>
className="overflow-visible"
/>
</SharedProposalsTableContextProvider>
) : (
<Typography tagVariant="p">No proposals found &#x1F622;</Typography>
)}
</div>
)
Expand Down

0 comments on commit 18f8f28

Please sign in to comment.