feat: wire frontend state and data flow for multi-chart support
- Add activeChartId/charts state to page.tsx with chart fetching on mount - ChartSelector integrated in sidebar between header and file upload - CandleChart and SvgOverlay fetch data scoped by activeChartId - FileUpload returns chart info, auto-selects new chart after upload - Annotation create/delete flows include chart_id - Export scoped by activeChartId - Toolbox receives activeChartId prop
This commit is contained in:
parent
a3c7137b01
commit
b9771fe89f
6 changed files with 126 additions and 37 deletions
|
|
@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
|
|||
import { Upload } from 'lucide-react';
|
||||
|
||||
interface FileUploadProps {
|
||||
onUploadSuccess: () => void;
|
||||
onUploadSuccess: (chart: { id: number; name: string }) => void;
|
||||
}
|
||||
|
||||
export default function FileUpload({ onUploadSuccess }: FileUploadProps) {
|
||||
|
|
@ -36,7 +36,7 @@ export default function FileUpload({ onUploadSuccess }: FileUploadProps) {
|
|||
type: 'success',
|
||||
text: `Successfully uploaded ${data.count} candle records`,
|
||||
});
|
||||
onUploadSuccess();
|
||||
onUploadSuccess(data.chart);
|
||||
} else {
|
||||
setMessage({
|
||||
type: 'error',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue