docbrown/app/javascript/Snackbar/__stories__/SnackbarItem.stories.jsx
Nick Taylor d3171fb3c8
Created Snackbar components (#7415)
Created the Snackbar components.
2020-04-23 08:27:50 -04:00

40 lines
846 B
JavaScript

import { h } from 'preact';
import { action } from '@storybook/addon-actions';
import { SnackbarItem } from '../SnackbarItem';
export default {
title: 'App Components/Snackbar/SnackbarItem',
};
export const JustAMessage = () => (
<SnackbarItem message="File uploaded successfully" />
);
JustAMessage.story = {
name: 'message only',
};
export const WithOneAction = () => (
<SnackbarItem
message="Changes saved"
actions={[{ text: 'Undo', handler: action('save file retry') }]}
/>
);
WithOneAction.story = {
name: 'with one action',
};
export const WithActions = () => (
<SnackbarItem
message="Unable to save file"
actions={[
{ text: 'Retry', handler: action('save file retry') },
{ text: 'Abort', handler: action('abort file save') },
]}
/>
);
WithActions.story = {
name: 'with actions',
};