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 = {
|
||||
id: string;
|
||||
label: string;
|
||||
description?: string | null;
|
||||
label: ReactNode;
|
||||
description?: ReactNode;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
@@ -37,11 +38,11 @@ export default function AdminSelectionList({
|
||||
}} />
|
||||
|
||||
<span>
|
||||
<strong>{translateText(option.label)}</strong>
|
||||
{option.description && <small>{translateText(option.description)}</small>}
|
||||
<strong>{translateReactNode(option.label, translateText)}</strong>
|
||||
{option.description && <small>{translateReactNode(option.description, translateText)}</small>}
|
||||
</span>
|
||||
</label>
|
||||
)}
|
||||
</div>);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user