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

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

export const 列表: ComponentStory<typeof OPList> = (): JSX.Element => {
  const dataSource = [
    {
      name: '哈哈哈',
      value: 'lalala',
    },
    {
      name: '哈哈哈22',
      value: 'lalala222',
    },
  ];

  return (
    <OPList
      dataSource={dataSource}
      renderItem={(record, index) => (
        <>
          <div>{record.name}</div>
        </>
      )}
      renderDetails={(record, index) => <div>{record.name}</div>}
    />
  );
};
