// Copyright (C) 2017-2020 Smart code 203358507
const React = require('react');
const { storiesOf } = require('@storybook/react');
const { Toasts } = require('stremio/common');
const styles = require('./styles');
storiesOf('Toast', module).add('SimpleToast', () => {
const toastRef = React.useRef(null);
const showToast = React.useCallback((message) => {
toastRef.current.show({
title: 'Something to take your attention',
timeout: 0,
type: 'info',
icon: 'ic_sub',
closeButton: true,
...message
});
}, [toastRef.current]);
const clickSuccess = () => showToast({
title: 'You clicked it',
text: 'Congratulations! Click event handled successfully.',
type: 'success',
icon: 'ic_check',
timeout: 2e3
});
return (
);
});