diff --git a/app/[locale]/download/components/CloudImage/Table/DataTable.tsx b/app/[locale]/download/components/CloudImage/Table/DataTable.tsx index 5cb2ee85..335c4338 100644 --- a/app/[locale]/download/components/CloudImage/Table/DataTable.tsx +++ b/app/[locale]/download/components/CloudImage/Table/DataTable.tsx @@ -36,10 +36,8 @@ interface DataTableProps { } const fuzzyFilter: FilterFn = (row, columnId, value, addMeta) => { - // Rank the item const itemRank = rankItem(row.getValue(columnId), value); - // Store the itemRank info addMeta({ itemRank, }); @@ -82,12 +80,17 @@ export function DataTable({ }); React.useEffect(() => { - if (table.getState().columnFilters[0]?.id === "fullName") { - if (table.getState().sorting[0]?.id !== "fullName") { - table.setSorting([{ id: "fullName", desc: false }]); - } + const columnFilters = table.getState().columnFilters[0]; + const sorting = table.getState().sorting[0]; + + if (columnFilters?.id === "fullName" && sorting?.id !== "fullName") { + table.setSorting([{ id: "fullName", desc: false }]); } - }, [table.getState().columnFilters[0]?.id]); + }, [table]); + + const noResultsText = "No results."; + const previousText = "Previous"; + const nextText = "Next"; return (
@@ -142,7 +145,7 @@ export function DataTable({ colSpan={columns.length} className="h-24 text-center" > - No results. + {noResultsText} )} @@ -155,7 +158,7 @@ export function DataTable({ onClick={() => table.previousPage()} disabled={!table.getCanPreviousPage()} > - Previous + {previousText}
diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index 3b370fc5..7d359c0d 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -29,6 +29,8 @@ const DialogOverlay = React.forwardRef< )); DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; +const closeButtonText = "Close"; + const DialogContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef @@ -46,7 +48,7 @@ const DialogContent = React.forwardRef< {children} - Close + {closeButtonText}