import React, { useEffect, useRef, useState } from 'react';
import { View, Button } from 'react-native';
import { storiesOf } from '@storybook/react-native';
import { Alert } from '.';

storiesOf('Select', module).add('default', () => {
   function Stub() {
      const openModal = (): void => {
         Alert.show({
            title: 'Hello, how are you?',
            message: 'Welcome, click the confirm button to win a bonus!',
            buttons: [
               {
                  text: 'Cancel',
                  bgColor: '#bbb',
                  onPress: () => {
                     console.log('sdds');
                  },
               },
               {
                  text: 'Confirm',
                  bgColor: '#222',
                  onPress: () => {
                     console.log('sdds');
                  },
               },
            ],
         });
      }

      return (
         <View style={{ padding: 10 }}>
            <Button title="Open Alert" onPress={() => openModal()} />
            <Alert />
         </View>
      );
   }

   return <Stub />;
});
