Files
smart-crop-ui/crop-x/src/App.tsx

244 lines
9.9 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react'
import { useTheme } from '@/hooks/useTheme'
function App() {
const { theme, setTheme } = useTheme()
return (
<div className="min-h-screen bg-background text-foreground">
{/* 头部导航 */}
<header className="nav-agriculture">
<div className="container-agriculture mx-auto px-4 py-4">
<div className="flex items-center justify-between">
<div className="flex items-center space-x-4">
<h1 className="text-2xl font-bold text-white">
🌾
</h1>
</div>
<div className="flex items-center space-x-4">
{/* 主题切换按钮 */}
<button
onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
className="px-3 py-2 rounded-md bg-white/20 hover:bg-white/30 text-white transition-colors"
>
{theme === 'light' ? '🌙' : '☀️'}
</button>
</div>
</div>
</div>
</header>
{/* 主要内容区域 */}
<main className="container-agriculture mx-auto px-4 py-8">
{/* 欢迎页面 */}
<div className="text-center mb-12">
<h2 className="text-4xl font-bold mb-4 text-agriculture-green">
使
</h2>
<p className="text-xl text-muted-foreground mb-8">
React 18 + Vite 6 + TypeScript + shadcn/ui
</p>
</div>
{/* 系统状态卡片 */}
<div className="grid-agriculture mb-12">
<div className="card-agriculture p-6">
<div className="flex items-center mb-4">
<div className="w-12 h-12 bg-green-100 rounded-lg flex items-center justify-center mr-4">
🚜
</div>
<div>
<h3 className="text-lg font-semibold"></h3>
<p className="text-sm text-muted-foreground">920</p>
</div>
</div>
<div className="space-y-2">
<div className="flex justify-between text-sm">
<span></span>
<span className="text-green-600"> </span>
</div>
<div className="flex justify-between text-sm">
<span></span>
<span className="text-green-600"> </span>
</div>
<div className="flex justify-between text-sm">
<span></span>
<span className="text-green-600"> </span>
</div>
</div>
</div>
<div className="card-agriculture p-6">
<div className="flex items-center mb-4">
<div className="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center mr-4">
🌾
</div>
<div>
<h3 className="text-lg font-semibold"></h3>
<p className="text-sm text-muted-foreground"></p>
</div>
</div>
<div className="space-y-2">
<div className="flex justify-between text-sm">
<span></span>
<span className="text-blue-600"> </span>
</div>
<div className="flex justify-between text-sm">
<span></span>
<span className="text-blue-600"> </span>
</div>
<div className="flex justify-between text-sm">
<span></span>
<span className="text-blue-600"> </span>
</div>
</div>
</div>
<div className="card-agriculture p-6">
<div className="flex items-center mb-4">
<div className="w-12 h-12 bg-amber-100 rounded-lg flex items-center justify-center mr-4">
📊
</div>
<div>
<h3 className="text-lg font-semibold"></h3>
<p className="text-sm text-muted-foreground"></p>
</div>
</div>
<div className="space-y-2">
<div className="flex justify-between text-sm">
<span></span>
<span className="text-amber-600">0 </span>
</div>
<div className="flex justify-between text-sm">
<span></span>
<span className="text-amber-600">0 </span>
</div>
<div className="flex justify-between text-sm">
<span></span>
<span className="text-amber-600">0 </span>
</div>
</div>
</div>
<div className="card-agriculture p-6">
<div className="flex items-center mb-4">
<div className="w-12 h-12 bg-purple-100 rounded-lg flex items-center justify-center mr-4">
</div>
<div>
<h3 className="text-lg font-semibold"></h3>
<p className="text-sm text-muted-foreground"></p>
</div>
</div>
<div className="space-y-2">
<div className="flex justify-between text-sm">
<span></span>
<span className="text-purple-600"> </span>
</div>
<div className="flex justify-between text-sm">
<span></span>
<span className="text-purple-600"> </span>
</div>
<div className="flex justify-between text-sm">
<span></span>
<span className="text-purple-600"> </span>
</div>
</div>
</div>
</div>
{/* 技术栈展示 */}
<div className="card-agriculture p-8 mb-12">
<h3 className="text-2xl font-bold mb-6 text-center">🛠 </h3>
<div className="grid grid-cols-2 md:grid-cols-4 gap-6">
<div className="text-center">
<div className="text-3xl mb-2"></div>
<h4 className="font-semibold">React 18</h4>
<p className="text-sm text-muted-foreground">UI框架</p>
</div>
<div className="text-center">
<div className="text-3xl mb-2">🚀</div>
<h4 className="font-semibold">Vite 6</h4>
<p className="text-sm text-muted-foreground"></p>
</div>
<div className="text-center">
<div className="text-3xl mb-2">📘</div>
<h4 className="font-semibold">TypeScript</h4>
<p className="text-sm text-muted-foreground"></p>
</div>
<div className="text-center">
<div className="text-3xl mb-2">🎨</div>
<h4 className="font-semibold">Tailwind CSS</h4>
<p className="text-sm text-muted-foreground">CSS</p>
</div>
<div className="text-center">
<div className="text-3xl mb-2">🧩</div>
<h4 className="font-semibold">shadcn/ui</h4>
<p className="text-sm text-muted-foreground"></p>
</div>
<div className="text-center">
<div className="text-3xl mb-2">📊</div>
<h4 className="font-semibold">Recharts</h4>
<p className="text-sm text-muted-foreground"></p>
</div>
<div className="text-center">
<div className="text-3xl mb-2">🔧</div>
<h4 className="font-semibold">ESLint</h4>
<p className="text-sm text-muted-foreground"></p>
</div>
<div className="text-center">
<div className="text-3xl mb-2">💅</div>
<h4 className="font-semibold">Prettier</h4>
<p className="text-sm text-muted-foreground"></p>
</div>
</div>
</div>
{/* 快速操作按钮 */}
<div className="text-center">
<div className="space-x-4">
<button
onClick={() => window.location.href = '/machinery'}
className="btn-agriculture px-6 py-3 rounded-lg font-semibold mr-4"
>
🚜
</button>
<button
onClick={() => window.location.href = '/field'}
className="btn-agriculture-secondary px-6 py-3 rounded-lg font-semibold"
>
🌾
</button>
</div>
</div>
{/* 开发工具状态 */}
<div className="mt-12 p-4 bg-muted rounded-lg">
<h4 className="font-semibold mb-2">🔧 </h4>
<div className="text-sm text-muted-foreground">
<p> </p>
<p> </p>
<p> </p>
<p> TypeScript类型检查已配置</p>
<p> ESLint/Prettier可通过开关控制</p>
</div>
</div>
</main>
{/* 页脚 */}
<footer className="bg-muted py-8 mt-16">
<div className="container-agriculture mx-auto px-4 text-center">
<p className="text-muted-foreground">
v1.0.0 | React 18 + Vite 6 + TypeScript
</p>
<p className="text-sm text-muted-foreground mt-2">
🌾 |
</p>
</div>
</footer>
</div>
)
}
export default App