Skip to content

Commit

Permalink
Update noResultsWord to noResultsText in DataTable
Browse files Browse the repository at this point in the history
component
  • Loading branch information
Jennievon committed Jul 8, 2024
1 parent 06b03f6 commit 5e9426d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion tools/tenscan/frontend/pages/batches/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function Batches() {
refetch={refetchBatches}
total={+Total}
isLoading={isBatchesLoading}
noResultsWord="batches"
noResultsText="batches"
/>
</div>
</Layout>
Expand Down
2 changes: 1 addition & 1 deletion tools/tenscan/frontend/pages/blocks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function Blocks() {
total={+Total}
refetch={refetchBlocks}
isLoading={isBlocksLoading}
noResultsWord="blocks"
noResultsText="blocks"
/>
</div>
</Layout>
Expand Down
2 changes: 1 addition & 1 deletion tools/tenscan/frontend/pages/rollups/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function Rollups() {
refetch={refetchRollups}
total={+Total}
isLoading={isRollupsLoading}
noResultsWord="rollups"
noResultsText="rollups"
/>
</div>
</Layout>
Expand Down
2 changes: 1 addition & 1 deletion tools/tenscan/frontend/pages/transactions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function Transactions() {
refetch={refetchTransactions}
total={+Total}
isLoading={isTransactionsLoading}
noResultsWord="transactions"
noResultsText="transactions"
/>
</div>
</Layout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface DataTableProps<TData, TValue> {
total: number;
isLoading?: boolean;
noPagination?: boolean;
noResultsWord?: string;
noResultsText?: string;
noResultsMessage?: string;
}

Expand All @@ -57,7 +57,7 @@ export function DataTable<TData, TValue>({
total,
isLoading,
noPagination,
noResultsWord,
noResultsText,
noResultsMessage,
}: DataTableProps<TData, TValue>) {
const { query, push, pathname } = useRouter();
Expand Down Expand Up @@ -175,7 +175,7 @@ export function DataTable<TData, TValue>({
>
{pagination.pageIndex > 1 ? (
<p>
No {noResultsWord || "results"} found for the selected
No {noResultsText || "results"} found for the selected
filters.
<Button
variant={"link"}
Expand All @@ -190,7 +190,7 @@ export function DataTable<TData, TValue>({
) : (
<p>
{noResultsMessage ||
`No ${noResultsWord || "results"} found.`}
`No ${noResultsText || "results"} found.`}
</p>
)}
</TableCell>
Expand All @@ -199,7 +199,7 @@ export function DataTable<TData, TValue>({
</TableBody>
</Table>
</div>
{(data || isLoading) && !noPagination && (
{data && !isLoading && !noPagination && (
<DataTablePagination
table={table}
refetch={refetch}
Expand Down
14 changes: 7 additions & 7 deletions tools/tenscan/frontend/src/components/modules/personal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export default function PersonalTransactions() {
</p> */}
</div>
</div>
{personalTxnsLoading ? (
<Skeleton className="h-96" />
) : Receipts ? (
<DataTable columns={columns} data={Receipts} total={Total} />
) : (
<p>No transactions found.</p>
)}
<DataTable
columns={columns}
data={Receipts}
total={Total}
isLoading={personalTxnsLoading}
noResultsText="personal transactions"
/>
</>
);
}

0 comments on commit 5e9426d

Please sign in to comment.