bbgo_origin/frontend/pages/strategies.tsx

26 lines
631 B
TypeScript
Raw Normal View History

2022-06-14 09:30:33 +00:00
import DashboardLayout from '../layouts/DashboardLayout';
2022-06-15 10:57:28 +00:00
import { useEffect, useState } from 'react';
2022-06-16 04:36:45 +00:00
import { queryStrategiesMetrics } from '../api/bbgo';
import type { GridStrategy } from '../api/bbgo';
2022-06-14 09:30:33 +00:00
2022-06-16 08:47:35 +00:00
import Detail from '../components/Detail';
2022-06-14 09:30:33 +00:00
2022-06-15 11:02:24 +00:00
export default function Strategies() {
2022-06-16 04:36:45 +00:00
const [details, setDetails] = useState<GridStrategy[]>([]);
2022-06-15 10:57:28 +00:00
useEffect(() => {
queryStrategiesMetrics().then((value) => {
setDetails(value);
2022-06-15 11:02:24 +00:00
});
}, []);
2022-06-14 09:30:33 +00:00
return (
<DashboardLayout>
2022-06-15 10:57:28 +00:00
{details.map((element) => {
2022-06-15 11:02:24 +00:00
return <Detail key={element.id} data={element} />;
2022-06-15 10:57:28 +00:00
})}
</DashboardLayout>
);
}