import {
	PageContainer,
	WxMaMessagePushConfig,
	WxMaSubscribeMessageConfig,
} from '@/components';
import { WxMaConfig } from '@/components/Setting';
import { ProCard } from '@ant-design/pro-components';
import { useState } from 'react';
import SmartRecognitionPromptConfig from '../components/Setting/SmartRecognitionPromptConfig';

export default function Page() {
	const [activeKey, setActiveKey] = useState<string>('1');

	return (
		<PageContainer
			permission={'MDB_BUSINESS_MINI_PROGRAM_CONFIG'}
			fieldProps={{
				tabActiveKey: activeKey,
				onTabChange: (activeKey) => {
					setActiveKey(activeKey);
				},
				tabList: [
					{
						key: '1',
						tab: '小程序配置',
					},
					{
						key: '2',
						tab: '消息推送设置',
					},
					{
						key: '3',
						tab: '订阅消息配置',
					},
					{
						key: '4',
						tab: '智能识别',
					},
				],
			}}
		>
			{activeKey === '1' && (
				<ProCard>
					<WxMaConfig />
				</ProCard>
			)}

			{activeKey === '2' && (
				<ProCard>
					<WxMaMessagePushConfig />
				</ProCard>
			)}

			{activeKey === '3' && (
				<ProCard>
					<WxMaSubscribeMessageConfig />
				</ProCard>
			)}

			{activeKey === '4' && (
				<ProCard>
					<SmartRecognitionPromptConfig />
				</ProCard>
			)}
		</PageContainer>
	);
}
