import { Ionicons } from '@expo/vector-icons'
import { Block, Text } from '@share/components'
import { router, Stack } from 'expo-router'
import React from 'react'
import { ScrollView } from 'react-native'

export default function PrivacyPage() {
  const renderHeader = () => (
    <Block className="flex-row items-center justify-between px-[16px] py-[10px]">
      <Block className="ml-[-8px] size-[40px] items-center justify-center" opacity={0.7} onClick={() => router.back()}>
        <Ionicons color="#323232" name="chevron-back" size={24} />
      </Block>
      <Text className="text-[16px] font-[700] text-[#323232]">隐私协议 / Privacy Policy</Text>
      <Block className="w-[32px]" />
    </Block>
  )

  const renderSectionTitle = (children: React.ReactNode) => (
    <Text className="mt-[16px] text-[15px] font-[700] text-[#111827]">{children}</Text>
  )

  const renderParagraph = (children: React.ReactNode) => (
    <Text className="mt-[8px] text-[14px] leading-[22px] text-[#111827]">{children}</Text>
  )

  const renderBullet = (children: React.ReactNode) => (
    <Text className="mt-[6px] text-[14px] leading-[22px] text-[#111827]">• {children}</Text>
  )

  return (
    <Block className="flex-1 bg-[#fafafa]">
      <Stack.Screen options={{ headerShown: false }} />
      {renderHeader()}

      <ScrollView
        className="flex-1 px-[16px] pb-[24px]"
        contentContainerStyle={{ paddingBottom: 44 }}
        showsVerticalScrollIndicator={false}
      >
        {renderSectionTitle('1. 引言 / Introduction')}
        {renderParagraph(
          'BOWONG AI (HK) LIMITED（以下简称“我们”）非常重视您的隐私。本隐私政策说明了我们在您使用服务时如何处理您的信息。',
        )}
        {renderParagraph(
          'BOWONG AI (HK) LIMITED (hereinafter referred to as “we”) values your privacy highly. This Privacy Policy explains how we handle your information when you use our services.',
        )}

        {renderSectionTitle('2. 信息收集最小化声明 / Data Minimization Statement')}
        {renderSectionTitle('2.1 我们收集的信息 / Information We Collect')}
        {renderParagraph(
          '我们遵循数据最小化原则。为了提供服务及进行登录认证，我们仅收集和存储您注册时提供的电子邮箱地址（Email）。',
        )}
        {renderParagraph(
          'We adhere to the principle of data minimization. To provide our services and facilitate login authentication, we only collect and store the email address provided by you during registration.',
        )}

        {renderSectionTitle('2.2 我们不收集的信息 / Information We Do NOT Collect')}
        {renderParagraph('我们不存储您的姓名、电话号码、物理地址或任何其他个人身份信息。')}
        {renderParagraph(
          'We do not store your name, phone number, physical address, or any other personally identifiable information.',
        )}

        {renderSectionTitle('3. 支付信息安全 / Payment Information Security')}
        {renderSectionTitle('3.1 支付数据处理 / Payment Data Processing')}
        {renderParagraph(
          '所有的支付交易均由第三方支付处理商 Stripe 安全处理。我们不会在其服务器上存储或处理您的信用卡号、银行账户详情或任何敏感的支付信息。',
        )}
        {renderParagraph(
          'All payment transactions are securely processed by our third-party payment processor, Stripe. We do not store or process your credit card numbers, bank account details, or any sensitive payment information on our servers.',
        )}

        {renderSectionTitle('3.2 Stripe 隐私政策 / Stripe Privacy Policy')}
        {renderParagraph(
          '您提供的支付信息受 Stripe 隐私政策的约束。我们建议您阅读 Stripe 的隐私政策以了解其数据处理惯例。',
        )}
        {renderParagraph(
          'The payment information you provide is subject to Stripe’s Privacy Policy. We recommend that you review Stripe’s Privacy Policy to understand their data processing practices.',
        )}

        {renderSectionTitle('4. 信息的使用 / Use of Information')}
        {renderParagraph('您提供的电子邮件地址仅用于以下用途：')}
        {renderParagraph('Your email address is used solely for the following purposes:')}
        {renderBullet('作为您登录系统的唯一凭证； / As your unique credential for logging into the system;')}
        {renderBullet(
          '接收关于订阅状态、发票和系统更新的通知； / Receiving notifications regarding subscription status, invoices, and system updates;',
        )}
        {renderBullet('处理客户支持和退款请求。 / Processing customer support and refund requests.')}

        {renderSectionTitle('5. 数据共享与披露 / Data Sharing and Disclosure')}
        {renderParagraph(
          '除法律要求或为了执行我们的服务条款（例如通过 Stripe 处理付款）外，我们不会向任何第三方出售、出租或共享您的电子邮件地址。',
        )}
        {renderParagraph(
          'We will not sell, rent, or share your email address with any third parties, except as required by law or to enforce our terms of service (e.g., processing payments via Stripe).',
        )}

        {renderSectionTitle('6. 联系我们 / Contact Us')}
        {renderParagraph('如果您对本隐私政策有任何疑问，请通过以下方式联系我们：')}
        {renderParagraph('If you have any questions regarding this Privacy Policy, please contact us at:')}
        {renderParagraph('公司名称 / Company Name: BOWONG AI (HK) LIMITED')}
        {renderParagraph('客服邮箱 / Support Email: support@bowong.ai')}
      </ScrollView>
    </Block>
  )
}
