Skip to content

Commit

Permalink
fix: show translated language name on paginated table view
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinstadler committed Dec 9, 2024
1 parent 29ed1b6 commit 22f017c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/instantsearch-paginated-table.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Hit } from "instantsearch.js";
import { useTranslations } from "next-intl";
import type { ReactNode } from "react";
import { Hits } from "react-instantsearch";

Expand All @@ -9,6 +10,7 @@ import { ClickablePublicationThumbnail } from "./publication-cover";
import { PublicationLink } from "./publication-link";

function TableRow({ hit }: { hit: Hit<Publication> }) {
const lt = useTranslations("Languages");
const translators = [
...new Set(
hit.contains.flatMap((tr) => {
Expand Down Expand Up @@ -48,7 +50,12 @@ function TableRow({ hit }: { hit: Hit<Publication> }) {
})}
</InlineList>
</div>
<div>{hit.language}</div>
<div className="lowercase">
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
lt(hit.language as any)
}
</div>
</div>
</div>
);
Expand Down

0 comments on commit 22f017c

Please sign in to comment.