* basic i18n * tweak * translate app * add linting to make sure we have translations * run linter on pr * format
29 lines
1,022 B
TypeScript
29 lines
1,022 B
TypeScript
import React from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import { ToggleSwitch } from "../ui/ToggleSwitch";
|
|
import { useSettings } from "../../hooks/useSettings";
|
|
|
|
interface PostProcessingToggleProps {
|
|
descriptionMode?: "inline" | "tooltip";
|
|
grouped?: boolean;
|
|
}
|
|
|
|
export const PostProcessingToggle: React.FC<PostProcessingToggleProps> =
|
|
React.memo(({ descriptionMode = "tooltip", grouped = false }) => {
|
|
const { t } = useTranslation();
|
|
const { getSetting, updateSetting, isUpdating } = useSettings();
|
|
|
|
const enabled = getSetting("post_process_enabled") || false;
|
|
|
|
return (
|
|
<ToggleSwitch
|
|
checked={enabled}
|
|
onChange={(enabled) => updateSetting("post_process_enabled", enabled)}
|
|
isUpdating={isUpdating("post_process_enabled")}
|
|
label={t("settings.debug.postProcessingToggle.label")}
|
|
description={t("settings.debug.postProcessingToggle.description")}
|
|
descriptionMode={descriptionMode}
|
|
grouped={grouped}
|
|
/>
|
|
);
|
|
});
|