/*
 * File: ConfirmModal.tsx
 * Description: Confirmation modal using Clinical Blue Interface design system
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */

import React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import Modal from './Modal';
import Button from '../Button/Button';
import { Colors, Typography, Spacing } from '../../theme';

interface ConfirmModalProps {
  visible: boolean;
  title: string;
  message: string;
  onConfirm: () => void;
  onCancel: () => void;
}

/**
 * ConfirmModal component
 * - Shows a confirmation dialog with two actions
 */
const ConfirmModal: React.FC<ConfirmModalProps> = ({ visible, title, message, onConfirm, onCancel }) => (
  <Modal visible={visible} onRequestClose={onCancel}>
    <Text style={styles.title}>{title}</Text>
    <Text style={styles.message}>{message}</Text>
    <View style={styles.actions}>
      <Button title="Cancel" onPress={onCancel} style={styles.button} textStyle={styles.cancelText} />
      <Button title="Confirm" onPress={onConfirm} style={styles.button} />
    </View>
  </Modal>
);

const styles = StyleSheet.create({
  title: {
    fontFamily: Typography.fontFamily.bold,
    fontSize: Typography.fontSize.lg,
    color: Colors.textPrimary,
    marginBottom: Spacing.sm,
    textAlign: 'center',
  },
  message: {
    fontFamily: Typography.fontFamily.regular,
    fontSize: Typography.fontSize.md,
    color: Colors.textSecondary,
    marginBottom: Spacing.lg,
    textAlign: 'center',
  },
  actions: {
    flexDirection: 'row',
    justifyContent: 'space-between',
  },
  button: {
    flex: 1,
    marginHorizontal: Spacing.xs,
  },
  cancelText: {
    color: Colors.error,
  },
});

export default ConfirmModal;

/*
 * End of File: ConfirmModal.tsx
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */ 