import React from 'react';
import { Card, Button, Alert } from 'antd';
import { useParams, useNavigate } from 'react-router-dom';

const TestDetail = () => {
  const navigate = useNavigate();
  const { code } = useParams();

  console.log('TestDetail page loaded with code:', code);

  const handleBack = () => {
    navigate('/');
  };

  return React.createElement('div', {
    className: 'detail'
  }, [
    React.createElement('div', {
      key: 'header',
      className: 'detail-header'
    }, [
      React.createElement(Button, {
        key: 'back-button',
        type: 'default',
        onClick: handleBack,
        style: { marginBottom: 16 }
      }, '返回主页'),
      React.createElement('h2', {
        key: 'title'
      }, `测试详情页面 - ${code}`)
    ]),
    React.createElement(Card, {
      key: 'card',
      className: 'detail-card',
      style: { marginBottom: 24 }
    }, [
      React.createElement('h3', {
        key: 'subtitle'
      }, '测试信息'),
      React.createElement('p', {
        key: 'code'
      }, '代码: ', code),
      React.createElement('p', {
        key: 'message'
      }, '如果您看到此页面，说明路由和基本组件正常工作。')
    ])
  ]);
};

export default TestDetail;