import * as React from "react";
import {
  TouchableOpacity,
  Text,
  View,
  ViewProps,
  TextProps,
  ViewStyle,
} from "react-native";
import { styles, textStyles } from "./styles";
import { useThemeProvider } from "../../../providers/theme-provider";
interface Props extends TextProps {
  label: string;
  onPress?: () => void;
  viewStyle?: ViewStyle;
}

function LinkButton(props: Props) {
  return (
    <TouchableOpacity
      style={props.viewStyle}
      activeOpacity={0.9}
      onPress={props.onPress}
    >
      <View>
        <Text
          {...props}
          style={[
            textStyles.outlined,
            { fontSize: (props as any).style?.fontSize },
            props.style,
          ]}
        >
          {props.label}
        </Text>
        <View style={styles.underline} />
      </View>
    </TouchableOpacity>
  );
}

export default LinkButton;
