import React, { useEffect, useState } from 'react'
import { PageHeader, Row, Col, Card, Icon } from 'antd'
import CommunitySelect from '@/components/CommunitySelect'
import ABPart from './components/ABPart'
import BuildingStatic from './components/BuildingStatic'
import ShortCut from './components/ShortCut'
import CommAlert from './components/CommAlert'
import ScrollAlert from './components/ScrollAlert'

export default props => {
  const [communityId, setCommunityId] = useState()

  const randText = `精铸致远，盛道自来。
  今天的远道集团，以卓越的产品和服务创造高品质生活与理想工作为使命，建设家园，服务社会，创造美好生活。
  我们相信，致远需要我们时刻创新奋进，而盛道的来临也正因为我们每一天为创造美好而不懈的努力！`

  return (
    <div>
      <PageHeader
        title="工作台"
        backIcon={false}
        ghost={false}
        extra={[
          <CommunitySelect key="1" value={communityId} style={{minWidth: 200}} onChange={v => setCommunityId(v)} autoInited />
        ]}
      >
        <ABPart
          align="middle"
          a={<div style={{verticalAlign: 'center'}}><p>管理员您好, 祝您开心每一天! </p><p>{randText}</p></div>}
          b={<BuildingStatic communityId={communityId} />}
        />
      </PageHeader>

      <div style={{marginTop: 24}}><ShortCut communityId={communityId} /></div>
      
      <div style={{marginTop: 24}}>
        <ABPart
          a={<CommAlert communityId={communityId} />}
          b={<ScrollAlert communityId={communityId} />}
        />
      </div>
    </div>
  )
}
