Fundamental_Analysis/frontend/src/app/page.tsx
2025-10-28 23:31:28 +08:00

57 lines
2.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

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.

'use client';
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
export default function StockInputForm() {
const [symbol, setSymbol] = useState('');
const [market, setMarket] = useState('china');
const router = useRouter();
const handleSearch = () => {
if (symbol.trim()) {
router.push(`/report/${symbol.trim()}?market=${market}`);
}
};
return (
<div className="flex justify-center items-center h-full">
<Card className="w-full max-w-md">
<CardHeader>
<CardTitle></CardTitle>
<CardDescription></CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="space-y-2">
<label></label>
<Input
placeholder="例如: 600519.SH 或 AAPL"
value={symbol}
onChange={(e) => setSymbol(e.target.value)}
/>
</div>
<div className="space-y-2">
<label></label>
<Select value={market} onValueChange={setMarket}>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="china"></SelectItem>
<SelectItem value="hongkong"></SelectItem>
<SelectItem value="usa"></SelectItem>
<SelectItem value="japan"></SelectItem>
</SelectContent>
</Select>
</div>
<Button onClick={handleSearch} className="w-full"></Button>
</CardContent>
</Card>
</div>
);
}