import React from 'react';
import {StyleProp, ViewStyle} from 'react-native';
import Button from '@components/Button';
import {COLORS} from '@shared/colors';

import {styles} from './styles';

interface Props {
  onPress?: () => void;
  text: string;
  disabled?: boolean;
  style?: StyleProp<ViewStyle>;
}

function PublishButton({onPress, text, disabled, style}: Props) {
  return (
    <Button
      onPress={onPress}
      style={[
        styles.publishButtonContainer,
        {backgroundColor: disabled ? COLORS.GRAY_TWENTY : COLORS.PRIMARY},
        style,
      ]}
      disabled={disabled}
      text={text}
    />
  );
}

export default PublishButton;
