import type { Metadata } from 'next'
import { getLocale } from 'next-intl/server'

export const metadata: Metadata = {
  title: 'Contact Us',
  description: 'Get in touch with Trump Alpha for questions, feedback, or support. We respond within 24 hours.',
  alternates: {
    canonical: `${process.env.NEXT_PUBLIC_SITE_URL || 'https://trumpsignal.com'}/en/contact`,
  },
  robots: { index: false, follow: true },  // no SEO value in indexing a contact form
}

export default async function ContactPage() {
  const locale = await getLocale()
  const isZh = false  // i18n shelved — Chinese branches kept as dead code for future revival; see messages/zh.json

  return (
    <div className="page" style={{ maxWidth: 560 }}>
      <div className="page-head">
        <div>
          <h1 className="page-title">{isZh ? '联系我们' : 'Contact Us'}</h1>
          <p className="page-sub">{isZh ? '问题、反馈或支持请求都可以从这里发来。' : 'Questions, feedback, or support requests.'}</p>
        </div>
      </div>

      <div className="card" style={{ padding: 32 }}>
        <form
          action="mailto:support@bitnews.day"
          method="get"
          encType="text/plain"
        >
          <div className="field" style={{ marginBottom: 16 }}>
            <label htmlFor="subject">{isZh ? '主题' : 'Subject'}</label>
            <input id="subject" name="subject" type="text" placeholder={isZh ? '例如：机器人没有执行交易' : 'e.g. Bot not executing trades'} />
          </div>
          <div className="field" style={{ marginBottom: 24 }}>
            <label htmlFor="body">{isZh ? '内容' : 'Message'}</label>
            <textarea
              id="body"
              name="body"
              rows={6}
              placeholder={isZh ? '尽量详细描述你的问题或需求…' : 'Describe your issue or question in detail…'}
              style={{ width: '100%', resize: 'vertical' }}
            />
          </div>
          <button type="submit" className="btn amber lg">
            {isZh ? '用邮件客户端打开 →' : 'Open in mail client →'}
          </button>
        </form>

        <div style={{ marginTop: 28, paddingTop: 20, borderTop: '1px solid var(--line)', fontSize: 13, color: 'var(--ink-3)', lineHeight: 1.6 }}>
          <div style={{ marginBottom: 6 }}>{isZh ? '也可以直接发邮件给我们：' : 'You can also reach us directly:'}</div>
          <div>
            <a href="mailto:support@bitnews.day" style={{ color: 'var(--amber)' }}>support@bitnews.day</a>
          </div>
          <div style={{ marginTop: 8 }}>{isZh ? '通常会在 24 小时内回复。' : 'Response time: typically within 24 hours.'}</div>
        </div>
      </div>
    </div>
  )
}
