import React, { useEffect, useState } from 'react'
import { Form, Modal, Button, Input, InputNumber, Select, Radio, PageHeader, Tabs } from 'antd'
import { fetch, apis } from '@/utils/request'
import MainSeting from './components/MainSeting'
import TemplateSetting from './components/TemplateSetting'

const mpDetail = fetch(apis.mp.detail)

export default props => {
  const [detailData, setDetailData] = useState({})

  useEffect(() => {
    mpDetail().then(res => {
      setDetailData(res)
    })
  }, [])

  return (
    <div>
      <PageHeader title="公众号设置" backIcon={false} />
      <Tabs defaultActiveKey="1">
        <Tabs.TabPane tab="基础设置" key="1">
          <MainSeting value={detailData} />
        </Tabs.TabPane>
        <Tabs.TabPane tab="模板设置" key="2">
          <TemplateSetting value={detailData} />
        </Tabs.TabPane>
      </Tabs>
    </div>
  )
}
