/*
 * File: CaseDetailsScreen.tsx
 * Description: Screen for displaying case details
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { Button } from '../../../../shared/src/components/Button';
import { Card } from '../../../../shared/src/components/Card';
import { Colors, Spacing, Typography } from '../../../../shared/src/theme';
import { useSelector } from 'react-redux';
import { selectSelectedCase } from '../redux/caseReviewSelectors';
import { useAIOverlay } from '../hooks/useAIOverlay';

/**
 * CaseDetailsScreen - shows patient info, AI findings, and navigation to DICOM viewer
 */
const CaseDetailsScreen: React.FC<any> = ({ navigation }) => {
  const caseData = useSelector(selectSelectedCase);
  const { findings, confidence } = useAIOverlay();

  if (!caseData) {
    return <View style={styles.container}><Text>No case selected.</Text></View>;
  }

  return (
    <View style={styles.container}>
      <Card>
        <Text style={styles.title}>{caseData.patientName}</Text>
        <Text style={styles.label}>AI Findings:</Text>
        <Text style={styles.findings}>{findings}</Text>
        <Text style={styles.confidence}>Confidence: {confidence}%</Text>
        <Button title="View DICOM Images" onPress={() => navigation.navigate('DICOMViewer')} style={styles.button} />
      </Card>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: Colors.background,
    justifyContent: 'center',
    padding: Spacing.lg,
  },
  title: {
    fontFamily: Typography.fontFamily.bold,
    fontSize: Typography.fontSize.lg,
    color: Colors.primary,
    marginBottom: Spacing.md,
  },
  label: {
    fontFamily: Typography.fontFamily.bold,
    fontSize: Typography.fontSize.md,
    color: Colors.textPrimary,
    marginTop: Spacing.sm,
  },
  findings: {
    fontFamily: Typography.fontFamily.regular,
    fontSize: Typography.fontSize.md,
    color: Colors.textSecondary,
    marginBottom: Spacing.sm,
  },
  confidence: {
    fontFamily: Typography.fontFamily.regular,
    fontSize: Typography.fontSize.sm,
    color: Colors.info,
    marginBottom: Spacing.md,
  },
  button: {
    marginTop: Spacing.md,
  },
});

export default CaseDetailsScreen;

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