refactor: setting overview

This commit is contained in:
Tristan Yang
2023-05-15 13:14:29 +08:00
parent c551909e86
commit 27204a1c11
10 changed files with 55 additions and 36 deletions
+3 -8
View File
@@ -5,6 +5,7 @@ import { useEffect } from 'react';
import { toast } from 'react-hot-toast';
import StyledRadio from "../../../common/component/styled/Radio";
import { useAppSelector } from '../../../app/store';
import SettingBlock from './SettingBlock';
// type Props = {}
const Index = () => {
@@ -24,20 +25,14 @@ const Index = () => {
};
// if (!loadSuccess) return null;
return (
<div className="text-sm">
<p className="dark:text-gray-100 font-semibold">{t("title")}</p>
<p className="flex justify-between w-full text-gray-400 mb-2">
<span className="txt">
{t("desc")}
</span>
</p>
<SettingBlock title={t("title")} desc={t('desc')} >
<StyledRadio
options={[t("enable"), t("disable")]}
values={["true", "false"]}
value={`${currStatus}`}
onChange={handleToggle}
/>
</div>
</SettingBlock>
);
};