import React from 'react';
import BannerInfoCard from './components/BannerInfoCard';
import NavInfoCardList from './components/NavInfoCardList';
import FootInfoCard from './components/FootInfoCard';
import { TimeType } from './typing';

// 测试数据
import testData from './testData';

const { offendingData , rankingListData} = testData;
const Welcome: React.FC = () => {
  const isActive = (type: TimeType) => {
    console.log('isActive_type', type);
    // if (!rangePickerValue) {
    //   return '';
    // }
    // const value = getTimeDistance(type);
    // if (!value) {
    //   return '';
    // }
    // if (!rangePickerValue[0] || !rangePickerValue[1]) {
    //   return '';
    // }
    // if (
    //   rangePickerValue[0].isSame(value[0] as moment.Moment, 'day') &&
    //   rangePickerValue[1].isSame(value[1] as moment.Moment, 'day')
    // ) {
    //   return styles.currentDate;
    // }
    return '';
  };

  const selectDate = (type: TimeType) => {
    console.log('selectDate_type', type);
    // setRangePickerValue(getTimeDistance(type));
  };

  // const { token } = theme.useToken();
  // const { initialState } = useModel('@@initialState');
  return (
    <div className="Welcome_page_wrap">
      <NavInfoCardList></NavInfoCardList>
      <BannerInfoCard
        offendingData={offendingData || []}
        rankingListData={rankingListData || []}
        isActive={isActive}
        selectDate={selectDate}
      ></BannerInfoCard>
      <FootInfoCard></FootInfoCard>
    </div>
  );
};

export default Welcome;
