import React from 'react';
import { View, Button } from 'react-native';
import { faStar as faStarAlt } from '@fortawesome/free-regular-svg-icons';
import { faExternalLinkAlt, faPen, faStar, faTimes, faTrashAlt } from '@fortawesome/free-solid-svg-icons';
import { storiesOf } from '@storybook/react-native';
import ThemeVariables from 'shared/dist/config/theme';
import { openUrlBlank } from 'shared/dist/services/utils-hybrid.web';
import { ActionSheet, IItemsActionSheetOption } from '.';

storiesOf('ActionSheet', module).add('default', () => {
   function openActionSheet(): any {
      ActionSheet.show({
         options: [
            { text: `Editar`, key: 'edit', icon: faPen },
            { text: 'Deletar', key: 'delete', icon: faTrashAlt, iconColor: ThemeVariables.red },
            { text: 'Cancelar', key: 'cancel', icon: faTimes, cancel: true },
         ],
         onPress: (el: IItemsActionSheetOption, index: number): void => {
            console.log('sdsd');
         },
      });
   }

   return (
      <View style={{ flex: 1 }}>
         <View>
            <Button title="Open ActionSheet" onPress={() => openActionSheet()} />
         </View>
         <ActionSheet />
      </View>
   );
});
