import clsx from "clsx"; import styles from "./UpdateModal.module.scss"; import { useTranslation } from "react-i18next"; import { useStore_OpenedQuickSetting } from "@store"; import { usePlugins } from "@logics_configs"; import { useComputeMode, useUpdateSoftware, useIsSoftwareUpdating, useSoftwareVersion, } from "@logics_common"; import { PluginCompatibilityList } from "./plugins_compatibility_list/PluginCompatibilityList"; export const UpdateModal = () => { const { t } = useTranslation(); const { updateOpenedQuickSetting } = useStore_OpenedQuickSetting(); const { updateSoftware, updateSoftware_CUDA } = useUpdateSoftware(); const { updateIsSoftwareUpdating } = useIsSoftwareUpdating(); const { currentComputeMode } = useComputeMode(); const { currentLatestSoftwareVersionInfo } = useSoftwareVersion(); const { isAnyPluginEnabled } = usePlugins(); const is_latest_version_already = currentLatestSoftwareVersionInfo.data.is_update_available === false; const is_cpu_version = currentComputeMode.data === "cpu"; const onClickUpdateSoftware = () => { updateIsSoftwareUpdating(true); updateSoftware(); } const onClickUpdateSoftware_CUDA = () => { updateIsSoftwareUpdating(true); updateSoftware_CUDA(); } const cpu_accept_button_class_name = clsx(styles.accept_button, { [styles.current_compute_version]: is_cpu_version, [styles.is_latest_version_already]: is_latest_version_already, }) const cuda_accept_button_class_name = clsx(styles.accept_button, { [styles.current_compute_version]: !is_cpu_version, [styles.is_latest_version_already]: is_latest_version_already, }) return (
{t("update_modal.download_latest_and_restart")}
{`- ${props.desc}`}
{t("update_modal.is_latest_version_already")}
; } return{t("update_modal.is_current_compute_device")}
; };