keycloak-scim/stories/5-AlertPanel.stories.js
Erik Jan de Wit 9b6e389da1 update story
2020-08-20 15:46:21 +02:00

18 lines
677 B
JavaScript

import React from 'react';
import { AlertVariant, Button } from '@patternfly/react-core';
import { storiesOf } from '@storybook/react';
import { AlertPanel } from '../src/components/alert/AlertPanel';
import { useAlerts } from '../src/components/alert/Alerts';
storiesOf('Alert Panel')
.add('api', () => <AlertPanel alerts={[{ key: 1, message: 'Hello', variant: AlertVariant.default }]} onCloseAlert={() => { }} />)
.add('add alert', () => {
const [add, alerts, hide] = useAlerts();
return (
<>
<AlertPanel alerts={alerts} onCloseAlert={hide} />
<Button onClick={() => add('Hello', AlertVariant.default)}>Add</Button>
</>
);
});