import React from 'react'
import styles from './index.module.scss'
import { Button } from 'antd'
import Y1main from './Y1main'
import { openGoodsInfoFu } from '@/utils/history'

type Props = {
  sId: number
  closeFu: () => void
}

function Y1cathet({ sId, closeFu }: Props) {
  return (
    <div className={styles.Y1cathet} style={{ right: sId ? '0px' : '-900px' }}>
      <div className='Y1top'>
        <h2>藏品详情</h2>
        <div>
          <span>更多操作请在详情页中进行</span>&emsp;
          <Button type='primary' onClick={() => openGoodsInfoFu(sId)}>
            查看详情
          </Button>
          &emsp;<Button onClick={closeFu}>收起</Button>
        </div>
      </div>
      {sId ? <Y1main sId={sId} key={sId} /> : null}
    </div>
  )
}

const MemoY1cathet = React.memo(Y1cathet)

export default MemoY1cathet
