/**
 * KRA - Dashboard Wiki Component
 * 与GVA wiki.vue 逻辑一致 - 文档链接
 */
import React from 'react';
import { Card, Row, Col } from 'antd';

interface WikiItem {
  title: string;
  url: string;
}

const wikis: WikiItem[] = [
  {
    title: 'React',
    url: 'https://react.dev/'
  },
  {
    title: 'Kratos 文档',
    url: 'https://go-kratos.dev/'
  },
  {
    title: 'Ant Design',
    url: 'https://ant.design/'
  },
  {
    title: 'UmiJS',
    url: 'https://umijs.org/'
  },
  {
    title: 'GitHub 仓库',
    url: 'https://github.com/go-kratos/kratos'
  }
];

const Wiki: React.FC = () => {
  return (
    <Card title="文档" className="kra-dashboard-card" variant="borderless" extra={<a href="#">更多</a>}>
      <Row gutter={[8, 8]}>
        {wikis.map((item, index) => (
          <Col span={12} key={index}>
            <a
              href={item.url}
              target="_blank"
              rel="noopener noreferrer"
              style={{
                fontSize: '14px',
                color: '#666',
                textDecoration: 'none',
              }}
              onMouseEnter={(e) => (e.currentTarget.style.color = '#1890ff')}
              onMouseLeave={(e) => (e.currentTarget.style.color = '#666')}
            >
              {item.title}
            </a>
          </Col>
        ))}
      </Row>
    </Card>
  );
};

export default Wiki;
