import React from 'react';
import { Button, Dialog, Portal, Text } from 'react-native-paper';

type CustomDialogProps = {
  visible: boolean;
  hideDialog: () => void;
  contentText: string;
  titleText?: string;
};

const DialogComponent: React.FC<CustomDialogProps> = ({
  visible,
  hideDialog,
  contentText,
}) => {
  return (
    <Portal>
      <Dialog visible={visible} onDismiss={hideDialog}>
        <Dialog.Content>
          <Text variant="titleMedium">{contentText}</Text>
        </Dialog.Content>
        <Dialog.Actions>
          <Button onPress={hideDialog}>Done</Button>
        </Dialog.Actions>
      </Dialog>
    </Portal>
  );
};

export { DialogComponent };
