import React from 'react';
import VtxBaseModal from '../vtx-base-modal';
import { OverView, WGGS, TFRD, WGXW, Alarm, SPJK } from './components';
import { overViewService } from "./api";

export interface ThrowPointModalProps {
    visible?: boolean;
    onCancel?: () => void;
    theme?: 'dark' | 'light';
    title?: '',
    id: string
}

const TABS = [
    {
        key: 'overview',
        title: '综合总览',
    },
    {
        key: 'wggs',
        title: '违规人公示',
    },
    {
        key: 'tfrd',
        title: '居民投放热度',
    },
    {
        key: 'wgxw',
        title: '居民违规行为',
    },
    {
        key: 'alarm',
        title: '报警事件分析',
    },
    {
        key: 'video',
        title: '视频监控',
    },
    {
        key: 'device',
        title: '设备自检',
    },
];
const VtxHousingEstateModal = (props: ThrowPointModalProps) => {
    const { visible = false, onCancel, theme = 'dark', title = '', id } = props;
    const PREFIX = 'estate';
    const throwPoints = overViewService.throwPoints({
        housingEstateId: id,
    });
    const tabContents = {
        overview: <OverView classPrefix={PREFIX} id={id} throwPoints={throwPoints} />,
        wggs: <WGGS classPrefix={PREFIX} />,
        tfrd: <TFRD classPrefix={PREFIX} id={id} />,
        alarm: <Alarm classPrefix={PREFIX} />,
        wgxw: <WGXW classPrefix={PREFIX} id={id} />,
        video: <SPJK classPrefix={PREFIX} />,
        // device: <SBZJ classPrefix={PREFIX} />
    };
    return (
        <VtxBaseModal
            title={title}
            theme={theme}
            tabs={TABS}
            contents={tabContents}
            visible={visible}
            onCancel={onCancel}
        />
    );
};

export default VtxHousingEstateModal;
