import { useState, useEffect } from 'react'
import { useParams, useNavigate } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import {
  NavBar,
  Button,
  Modal,
  Input,
  Toast,
  ImageViewer,
  Empty
} from 'antd-mobile'
import { usedCarApi } from '@/services/api'
import styles from './detail.module.css'

// 贸易条款选项
const TRADE_TERMS = [
  { value: 'FOB', text: 'FOB' },
  { value: 'CIF', text: 'CIF' },
  { value: 'EXW', text: 'EXW' },
  { value: 'DDP', text: 'DDP' },
  { value: 'CIP', text: 'CIP' },
  { value: 'FCA', text: 'FCA' },
  { value: 'CFR', text: 'CFR' },
]

// 币种选项
const CURRENCIES = [
  { value: 'USD', text: '美元' },
  { value: 'CNY', text: '人民币' },
  { value: 'RUB', text: '卢布' },
  { value: 'AED', text: '迪拉姆' },
  { value: 'EUR', text: '欧元' }
]

// 语言选项
const LANGUAGES = [
  { value: 'en', text: '英语' },
  { value: 'ru', text: '俄语' },
  { value: 'es', text: '西班牙语' },
  { value: 'ar', text: '阿拉伯语' }
]

interface UsedCarDetail {
  id: number
  code: string
  product_name: string
  vin?: string
  price?: number
  source_place?: string
  plate_place?: string
  plate_time?: string
  displacement?: string
  mileage?: number
  power?: string
  body_color?: string
  condition_desc?: string
  images?: string
  images_pull?: Array<{ url: string; name?: string }>
  images_array?: string[]
  attachment?: string
  attachment_pull?: Array<{ url: string; name: string; src_pull?: string }>
  attachment_array?: Array<{ url: string; name: string }>
  pdf_src?: string
  created_at: string
  updated_at: string
}
