import React from 'react';

import {QueueRow} from './QueueRow';
import {QueueRows} from "./QueueRows";
import {Empty, Queried, Unqueried, UnqueriedNoURL} from './QueueRow.stories';

// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
    title: 'Example/QueueRows',
    component: QueueRows,
    // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
    argTypes: {
        backgroundColor: {control: 'color'},
    },
};

// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
const Template = (args) => <QueueRows {...args} />;

var allRows = {
    Empty,
    Unqueried,
    UnqueriedNoURL,
    Queried,
};

var rows = Object.keys(allRows).map((rowKey, index) => {
    const rowArgs = allRows[rowKey].args
    return <QueueRow key={index} arn={rowArgs.arn} itemCount={rowArgs.itemCount} qName={rowArgs.qName}
                     url={rowArgs.url}>{index}</QueueRow>
});

export const AllRowsKinds = Template.bind({});
AllRowsKinds.args = {rows};