import Layout from '@/component/layout';
import SizeBox from '@/component/sizeBox';
import { Cell } from '@taroify/core';
import { PropsWithChildren } from 'react';
import './index.scss'
import { Arrow } from "@taroify/icons"
import Taro from '@tarojs/taro';
import UserHelper from '@/helper/userHelper';
import RouteUtil from '@/utils/routeUtil';

interface ISettingProps {

}

const Setting = (props: PropsWithChildren<ISettingProps>) => {
    return (
        <Layout className='' >
            <SizeBox height={16} />
            {/* <Cell size="large" title="个性化推荐" bordered={false} rightIcon={<Switch size="24" />}  ></Cell> */}
            {/* <SizeBox height={8} /> */}
            <Cell onClick={()=>{
                RouteUtil.push("/pages/user/about/index")
            }} size="large" title="关于我们" bordered={false} rightIcon={<Arrow />}  ></Cell>
            <SizeBox height={8} />
            {/* <Cell size="large" title="清理缓存" bordered={false} rightIcon={<Arrow />}  ></Cell>
            <SizeBox height={8} /> */}
            <Cell  onClick={()=>{
                RouteUtil.push("/pages/user/off/index");
            }} size="large" title="账户注销" bordered={false} rightIcon={<Arrow />}  ></Cell>
            <SizeBox height={8} />
            <Cell
                onClick={() => {
                    Taro.showModal({
                        title: "是否退出登录",
                        success: (res) => {
                            if(res.confirm){
                                UserHelper.outLogin();
                            }
                        },
                    })
                }}
                size="large" title="安全退出" bordered={false} rightIcon={<Arrow />}  ></Cell>
        </Layout>
    )
}

export default Setting;