import type { BoxProps, VariantProps } from "@shopify/restyle";
import type { Theme } from "@themes/Theme";
import { TouchableOpacity } from "react-native";
import Card from "./Card";
import Box from "./bases/Box";
import ButtonBase from "./bases/ButtonBase";
import Text from "./bases/Text";

type Props = BoxProps<Theme> &
	VariantProps<Theme, "buttonVariants"> &
	VariantProps<Theme, "textVariants", "textVariants"> & {
		label: string;
		onPress: () => void;
	};

const Button = ({ onPress, label, textVariants, variant, ...rest }: Props) => {
	return (
		<TouchableOpacity>
			<ButtonBase variant={variant} justifyContent="center" alignItems="center" {...rest}>
				<Text variant={textVariants}>{label}</Text>
			</ButtonBase>
		</TouchableOpacity>
	);
};

export default Button;
