feat: create UI shell and components
- Toolbox component with tool selection (break up/down, line, delete) - FileUpload component with CSV upload functionality - Main page layout with sidebar and chart area - Tool state management and export functionality
This commit is contained in:
parent
096a80b229
commit
8d1e72579e
3 changed files with 218 additions and 6 deletions
|
|
@ -1,10 +1,45 @@
|
|||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import Toolbox, { Tool } from '@/components/Toolbox';
|
||||
import FileUpload from '@/components/FileUpload';
|
||||
|
||||
export default function Home() {
|
||||
const [activeTool, setActiveTool] = useState<Tool>(null);
|
||||
|
||||
const handleExport = () => {
|
||||
window.location.href = '/api/export';
|
||||
};
|
||||
|
||||
const handleUploadSuccess = () => {
|
||||
// TODO: Trigger chart refresh
|
||||
console.log('Upload successful - refresh chart');
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="min-h-screen p-8">
|
||||
<h1 className="text-2xl font-bold">Candle Annotator</h1>
|
||||
<p className="mt-4 text-slate-400">
|
||||
Upload CSV data and annotate candlestick charts
|
||||
</p>
|
||||
</main>
|
||||
<div className="flex h-screen">
|
||||
{/* Sidebar */}
|
||||
<aside className="flex flex-col">
|
||||
<div className="p-4 border-b border-border">
|
||||
<h1 className="text-xl font-bold">Candle Annotator</h1>
|
||||
</div>
|
||||
<div className="p-4">
|
||||
<FileUpload onUploadSuccess={handleUploadSuccess} />
|
||||
</div>
|
||||
<Toolbox
|
||||
activeTool={activeTool}
|
||||
onToolChange={setActiveTool}
|
||||
onExport={handleExport}
|
||||
/>
|
||||
</aside>
|
||||
|
||||
{/* Main chart area */}
|
||||
<main className="flex-1 flex items-center justify-center bg-background">
|
||||
<div className="text-muted-foreground text-center">
|
||||
<p className="text-lg">Upload a CSV file to view the candlestick chart</p>
|
||||
<p className="text-sm mt-2">CSV format: time, open, high, low, close</p>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue