// Button.stories.js

import React from "react";

import {text,select,boolean} from "@storybook/addon-knobs";

import { storiesOf } from "@storybook/react-native";

import { View, Alert,ScrollView } from "react-native";
import { Button } from "../../../src";

import tw from "../../../src/lib/tailwind"

storiesOf("Button", module)
	.addDecorator((getStory) => <View style={{flex: 1}}>{getStory()}</View>)
	.add("default", () => {
		return (
			<ScrollView style={tw.style("px-5 flex")}>
				<Button
					title={(text("title", "Button Label"))} 
					disabled={(boolean("disabled", false))} 	
					fullwidth={(boolean("fullwidth", false))} 
					variant={(select("variant", ['primary', 'secondary'], 'primary'))}
					size={(select("size", ['small', 'medium', 'large'], 'small'))}
					onPress={() => Alert.alert("Button was pressed")}/>
			</ScrollView>
		)}
	)

	
