import React from 'react';
import { StoryFn, Meta } from '@storybook/react';

import { ResourceState } from './ResourceState';

export default {
  title: 'Resource State',
  component: ResourceState,
} as Meta<typeof ResourceState>;

const Template: StoryFn<typeof ResourceState> = ({ state, message }) => (
  <ResourceState state={state} message={message} handleReload={() => alert('Resource browser reload')} />
);

export const Error = Template.bind({});
Error.args = {
  state: 'error',
  message: 'This is a resource browser error!',
};

export const Empty = Template.bind({});
Empty.args = {
  state: 'empty',
};
