Fundamental_Analysis/frontend/src/components/layout/Header.tsx
Lv, Qi 0c975bb8f1 Refactor: Remove legacy analysis results and implement workflow history
- **Common Contracts**: Updated DTOs and models to support workflow history; removed legacy analysis result DTOs.
- **Data Persistence Service**:
    - Removed `analysis_results` table logic and API endpoints.
    - Implemented `workflow_history` API and DB access (`history.rs`).
    - Fixed compilation errors and updated tests.
    - Exposed Postgres port in `docker-compose.yml` for easier debugging/offline checks.
- **API Gateway**:
    - Implemented `history` endpoints (get history list, get by ID).
    - Removed legacy `analysis-results` endpoints.
    - Fixed routing and handler logic in `api.rs`.
- **Report Generator Service**:
    - Removed dependency on legacy `analysis-results` persistence calls.
    - Fixed compilation errors.
- **Workflow Orchestrator**: Fixed warnings and minor logic issues.
- **Providers**: Updated provider services (alphavantage, tushare, finnhub, yfinance, mock) to align with contract changes.
- **Frontend**:
    - Updated `ReportPage` and stores to use new workflow history.
    - Added `RecentReportsDropdown` component.
    - Cleaned up `RealtimeLogs` component.
- **Documentation**: Moved completed design tasks to `completed/` and added refactoring context docs.

Confirmed all services pass `cargo check`.
2025-11-29 14:46:44 +08:00

52 lines
1.8 KiB
TypeScript

import { Link, useLocation } from 'react-router-dom';
import { cn } from '@/lib/utils';
import { RecentReportsDropdown } from '../RecentReportsDropdown';
export function Header() {
const location = useLocation();
return (
<header className="border-b bg-background sticky top-0 z-50 w-full border-border/40 backdrop-blur supports-[backdrop-filter]:bg-background/60">
<div className="container mx-auto flex h-16 items-center justify-between px-4">
<div className="flex items-center gap-6">
<Link to="/" className="flex items-center space-x-2">
<span className="text-lg font-bold tracking-tight">FA Platform</span>
</Link>
<nav className="flex items-center gap-4 text-sm font-medium">
<Link
to="/"
className={cn(
"transition-colors hover:text-foreground/80",
location.pathname === "/" ? "text-foreground" : "text-foreground/60"
)}
>
</Link>
<Link
to="/docs"
className={cn(
"transition-colors hover:text-foreground/80",
location.pathname.startsWith("/docs") ? "text-foreground" : "text-foreground/60"
)}
>
</Link>
<Link
to="/config"
className={cn(
"transition-colors hover:text-foreground/80",
location.pathname.startsWith("/config") ? "text-foreground" : "text-foreground/60"
)}
>
</Link>
</nav>
</div>
<div className="flex items-center gap-2">
<RecentReportsDropdown />
</div>
</div>
</header>
);
}