-
-
-
- {t("component.placeholderVideo.creditTitleText")}{" "}
- {video.credits?.discord &&
- t("component.placeholderVideo.discordCredit", {
- user: video.credits.discord.user,
- guild: (
+
+
+
+
+ {t("component.placeholderVideo.creditTitleText")}{" "}
+ {video.credits?.discord &&
+ t("component.placeholderVideo.discordCredit", {
+ user: video.credits.discord.user,
+ guild: (
+
+
+
+ {video.credits.discord.guildName}
+
+
+ ),
+ })}
+ {video.credits?.datasource && (
+
+ {t("component.placeholderVideo.datasourceCredit", {
+ 0: video.credits.datasource.name,
+ })}
-
-
- {video.credits.discord.guildName}
+
+
+ {video.credits.datasource.link}
- ),
- })}
- {video.credits?.datasource && (
-
- {t("component.placeholderVideo.datasourceCredit", {
- 0: video.credits.datasource.name,
- })}
-
-
-
- {video.credits.datasource.link}
-
-
-
- )}
- {video.credits?.bot && (
-
- {t("component.placeholderVideo.botCredit", {
- 0: video.credits.bot.name,
- 1: video.credits.bot.user,
- })}
-
-
-
- {video.credits.bot.link}
-
-
-
- )}
- {video.credits?.editor && (
-
- {t("component.placeholderVideo.editorCredit", {
- 0: video.credits.editor.name,
- })}
-
+
+ )}
+ {video.credits?.bot && (
+
+ {t("component.placeholderVideo.botCredit", {
+ 0: video.credits.bot.name,
+ 1: video.credits.bot.user,
+ })}
+
+
+ {video.credits.bot.link}
+
+
+
+
+ )}
+ {video.credits?.editor && (
+
+ {t("component.placeholderVideo.editorCredit", {
+ 0: video.credits.editor.name,
+ })}
+
+ )}
+
+ {user && user.role !== "user" && (
+
+
+ {video.id}
+
+
+
+
+
+
+
+
+ Are you sure?
+
+ This action cannot be undone.
+
+
+
+ Cancel
+
+ Delete
+
+
+
+
+
)}
- {user && user.role !== "user" && (
-
-
{video.id}
-
-
-
-
-
-
-
- Are you sure?
-
- This action cannot be undone.
-
-
-
- Cancel
-
- Delete
-
-
-
-
-
- )}
-
- ),
- [thumbnailSrc, video, t, user, showDeleteConfirm],
+ ),
+ [open, thumbnailSrc, video, nameFn, t, user, showDeleteConfirm],
);
if (isSmall) {
diff --git a/packages/react/src/store/settings.ts b/packages/react/src/store/settings.ts
index 9fa612572..ff3cac157 100644
--- a/packages/react/src/store/settings.ts
+++ b/packages/react/src/store/settings.ts
@@ -1,6 +1,7 @@
import { GET_ON_INIT } from "@/lib/consts";
import { atom, useAtomValue } from "jotai";
import { atomWithStorage } from "jotai/utils";
+import { useCallback } from "react";
// Define the interface for the new settings state
export interface HolodexSettings {
@@ -61,6 +62,18 @@ export function usePreferredName({
return useEnglishName ? english_name || name : name;
}
+export function useNamePrefFn() {
+ const useEnglishName = useAtomValue(englishNameAtom);
+
+ const prefFn = useCallback(
+ ({ name, english_name }: { name?: string; english_name?: string }) =>
+ useEnglishName ? english_name || name : name,
+ [useEnglishName],
+ );
+
+ return prefFn;
+}
+
export const clipLanguageAtom = atom(
(get) => get(settingsAtom).clipLanguage,
(get, set, newValue: string[]) => {