refactor(webui): generalize central selection lists
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
import { usePlatformLanguage } from "../../i18n/LanguageContext";
|
import type { ReactNode } from "react";
|
||||||
|
import { translateReactNode, usePlatformLanguage } from "../../i18n/LanguageContext";
|
||||||
|
|
||||||
type Option = {
|
type Option = {
|
||||||
id: string;
|
id: string;
|
||||||
label: string;
|
label: ReactNode;
|
||||||
description?: string | null;
|
description?: ReactNode;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -37,8 +38,8 @@ export default function AdminSelectionList({
|
|||||||
}} />
|
}} />
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
<strong>{translateText(option.label)}</strong>
|
<strong>{translateReactNode(option.label, translateText)}</strong>
|
||||||
{option.description && <small>{translateText(option.description)}</small>}
|
{option.description && <small>{translateReactNode(option.description, translateText)}</small>}
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user