import React from 'react';
import { storiesOf } from '@storybook/react';

import { paginationList } from '../../../storybook/data';
import { Pagination, Row, Cell } from '../index';

storiesOf('Web|Table', module)
  .add('pagination', () => (
    <Pagination
      list={paginationList}
      headerRowTemplate={
        <Row isHeader>
          <Cell>age</Cell>
          <Cell>sex</Cell>
          <Cell>location</Cell>
        </Row>
      }
      contentRowTemplate={(row, index) => {
        const { age, sex, location } = row;

        return (
          <Row key={index}>
            <Cell title={age} />
            <Cell title={sex} />
            <Cell title={location} />
          </Row>
        );
      }}
    />
  ))
