github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/stories/Modals.stories.tsx (about)

     1  import React from 'react';
     2  import ShowModal from '@ui/Modals';
     3  import Button from '@ui/Button';
     4  import { ComponentStory, ComponentMeta } from '@storybook/react';
     5  import '../webapp/sass/profile.scss';
     6  
     7  const Template: ComponentStory<typeof ShowModal> = ({
     8    title,
     9    confirmButtonText,
    10    danger,
    11  }) => {
    12    const handleClick = () => {
    13      ShowModal({ title, confirmButtonText, danger });
    14    };
    15  
    16    return (
    17      <Button kind={danger ? 'danger' : undefined} onClick={handleClick}>
    18        Button text
    19      </Button>
    20    );
    21  };
    22  
    23  export default {
    24    title: 'Components/Modals',
    25    component: ShowModal,
    26  } as ComponentMeta<typeof ShowModal>;
    27  
    28  export const ConfirmationModal = Template.bind({});
    29  
    30  ConfirmationModal.args = {
    31    title: 'Sample modal text',
    32    confirmButtonText: 'Sample button text',
    33    danger: false,
    34  };