42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import React, { useMemo } from 'react';
|
|
import { Card } from 'antd';
|
|
import {
|
|
CloudOutlined,
|
|
CompassOutlined,
|
|
DashboardOutlined,
|
|
RiseOutlined,
|
|
} from '@ant-design/icons';
|
|
|
|
const WeatherCard: React.FC = () => {
|
|
const weatherMetrics = useMemo(() => ([
|
|
{ label: '风速', value: '4.6 m/s', icon: <CompassOutlined /> },
|
|
{ label: '浪高', value: '1.2 m', icon: <DashboardOutlined /> },
|
|
{ label: '能见度', value: '7.8 km', icon: <CloudOutlined /> },
|
|
{ label: '潮位', value: '2.4 m', icon: <RiseOutlined /> },
|
|
]), []);
|
|
|
|
return (
|
|
<Card
|
|
title={
|
|
<span style={{ color: 'rgba(255,255,255,0.92)', display: 'flex', alignItems: 'center', gap: 8 }}>
|
|
<CloudOutlined style={{ color: '#00b4d8' }} /> 海况与气象
|
|
</span>
|
|
}
|
|
className="maritime-card"
|
|
size="small"
|
|
>
|
|
<div className="weather-panel">
|
|
{weatherMetrics.map((item) => (
|
|
<div className="weather-item" key={item.label}>
|
|
<div className="weather-icon">{item.icon}</div>
|
|
<div className="weather-value">{item.value}</div>
|
|
<div className="weather-label">{item.label}</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</Card>
|
|
);
|
|
};
|
|
|
|
export default WeatherCard;
|