import React, { useState } from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { OPSowingWall } from '../../src/index';

export default {
  title: '组件/数据展示/OPSowingWall',
  component: OPSowingWall,
} as ComponentMeta<typeof OPSowingWall>;

export const 播种墙: ComponentStory<typeof OPSowingWall> = (): JSX.Element => {
  return (
    <div style={{ height: '600px' }}>
      <OPSowingWall
        header={{
          title: '商品播种进度',
          tagList: [
            { children: '面单已打印', type: 'disabled' },
            { children: '警告', type: 'warning' },
          ],
          action: {
            children: '查看进度',
            hotkey: 'F1',
            type: 'text',
            onClick: () => {
              alert(1);
            },
          },
        }}
        // sowingWall={{
        //   baskets: [
        //     {
        //       actualNum: 1,
        //       basketNo: 'A1',
        //       bizUnitId: 29210340050,
        //       planNum: 3,
        //       seq: 1,
        //       content: '20/22',
        //     },
        //   ],
        //   cols: 10,
        //   rows: 10,
        //   sowingWallCode: 'LBX02261111779146824',
        // }}
        // sowingWall={{
        //   basketNoType: 2,
        //   baskets: [
        //     {
        //       actualNum: 0,
        //       basketNo: '1',
        //       bizUnitId: 29667836809,
        //       highlighted: false,
        //       planNum: 39,
        //     },
        //     {
        //       actualNum: 1,
        //       basketNo: '2',
        //       bizUnitId: 29693043034,
        //       highlighted: false,
        //       planNum: 2,
        //     },
        //   ],
        //   cols: 5,
        //   rows: 2,
        //   sowingWallCode: 'bzq039',
        // }}
        sowingWall={{
          baskets: [
            {
              planNum: 1,
              bizUnitId: 160012405356,
              // highlighted: true,
              basketNo: 'A1',
              actualNum: 1,
            },
            {
              planNum: 1,
              bizUnitId: 160012405357,
              basketNo: 'A2',
              actualNum: 0,
              status: 'LACK',
            },
            {
              planNum: 1,
              bizUnitId: 160012405358,
              basketNo: 'A3',
              actualNum: 1,
              status: 'FINISHED',
            },
            {
              planNum: 1,
              bizUnitId: 160012405357,
              basketNo: 'A4',
              actualNum: 0,
              status: 'INTERCEPTED',
            },
            {
              planNum: 11,
              bizUnitId: 160012405357,
              basketNo: 'A5',
              actualNum: 10,
              highlighted: true,
            },
          ],
          sowingWallCode: 'fx-bzq-0041',
          rows: 5,
          cols: 15,
          onClick: () => {
            alert(2);
          },
        }}
      />
    </div>
  );
};
