"use strict";

import { View, Text } from 'react-native';
import GroupedPillButtons from '../../components/internal/GroupedPillButtons';
import { Section, GroupedSection } from '../../components';
import { useI18n } from '../../hooks/useI18n';
import { stepStyles } from '../../styles/spacing';
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
const SignUpSummaryStep = ({
  colors,
  styles,
  theme,
  nextStep,
  prevStep,
  allStepData,
  isLoading
}) => {
  const {
    t
  } = useI18n();
  const baseStyles = stepStyles;
  // Extract data from previous steps
  const identityData = allStepData[1] || {}; // Step 2 (index 1)
  const securityData = allStepData[2] || {}; // Step 3 (index 2)

  const {
    username = '',
    email = ''
  } = identityData;
  const {
    password = ''
  } = securityData;

  // Check if all required data is available
  const hasValidData = username && email && password;
  return /*#__PURE__*/_jsxs(_Fragment, {
    children: [/*#__PURE__*/_jsxs(View, {
      style: [baseStyles.container, baseStyles.sectionSpacing, baseStyles.header],
      children: [/*#__PURE__*/_jsx(Text, {
        style: [styles.modernTitle, baseStyles.title, {
          color: colors.text,
          marginBottom: 0,
          marginTop: 0
        }],
        children: t('signup.summary.title')
      }), /*#__PURE__*/_jsx(Text, {
        style: [styles.modernSubtitle, baseStyles.subtitle, {
          color: colors.secondaryText,
          marginBottom: 0,
          marginTop: 0
        }],
        children: t('signup.summary.subtitle')
      })]
    }), /*#__PURE__*/_jsxs(View, {
      style: [baseStyles.container, baseStyles.sectionSpacing],
      children: [/*#__PURE__*/_jsx(Section, {
        title: t('signup.summary.sections.account') || t('signup.summary.sectionTitle') || 'Account Information',
        theme: theme,
        isFirst: true,
        children: /*#__PURE__*/_jsx(GroupedSection, {
          items: [{
            id: 'username',
            icon: 'person-outline',
            iconColor: colors.primary,
            title: t('signup.summary.fields.username'),
            subtitle: `@${username || t('signup.summary.notSet')}`,
            showChevron: false
          }, {
            id: 'email',
            icon: 'mail-outline',
            iconColor: colors.primary,
            title: t('signup.summary.fields.email'),
            subtitle: email || t('signup.summary.notSet'),
            showChevron: false
          }, {
            id: 'password',
            icon: 'lock-closed-outline',
            iconColor: colors.primary,
            title: t('signup.summary.fields.password') || 'Password',
            subtitle: password ? '••••••••' : t('signup.summary.notSet'),
            showChevron: false
          }],
          theme: theme
        })
      }), /*#__PURE__*/_jsx(Section, {
        title: t('signup.summary.sections.next') || 'Next Steps',
        theme: theme,
        children: /*#__PURE__*/_jsx(GroupedSection, {
          items: [{
            id: 'security-tip',
            icon: 'shield-checkmark',
            iconColor: colors.warning,
            title: t('signup.summary.next.securityTitle') || 'Keep your account secure',
            subtitle: t('signup.summary.securityTip'),
            showChevron: false,
            multiRow: true,
            dense: true
          }, {
            id: 'legal-reminder',
            icon: 'checkmark-circle',
            iconColor: colors.success,
            title: t('signup.summary.next.legalTitle') || 'You’re all set',
            subtitle: t('signup.summary.legalReminder'),
            showChevron: false,
            multiRow: true,
            dense: true
          }],
          theme: theme
        })
      })]
    }), /*#__PURE__*/_jsx(View, {
      style: [baseStyles.container, baseStyles.sectionSpacing, baseStyles.buttonContainer],
      children: /*#__PURE__*/_jsx(GroupedPillButtons, {
        buttons: [{
          text: t('common.actions.back'),
          onPress: prevStep,
          icon: 'arrow-back',
          variant: 'transparent'
        }, {
          text: t('common.actions.createAccount'),
          onPress: nextStep,
          icon: 'checkmark-circle',
          variant: 'primary',
          loading: isLoading,
          disabled: !hasValidData
        }],
        colors: colors
      })
    })]
  });
};
export default SignUpSummaryStep;
//# sourceMappingURL=SignUpSummaryStep.js.map