, current) => {
// const year = dayjs(current.date).format('YYYY');
@@ -51,7 +51,7 @@ const seriesData = Object.keys(dkk).map(year => ({
*/
const dt = props.data;
const years: string[] = []
- const dkk = dt.history.day.reduce((acc: { id: string }[], current) => {
+ const rowsData = dt.history.day.reduce((acc: { id: string }[], current) => {
const year = dayjs(current.date).format('YYYY');
const pm = ((current.close - current.open) / current.open);
const month = dayjs(current.date).month();
@@ -59,22 +59,22 @@ const seriesData = Object.keys(dkk).map(year => ({
if (!years.includes(year)) years.push(year);
return acc
}, months.map(j => ({ id: j })));
- debugger;
const columns: GridColDef[] = [
- { field: 'id', width: 120, headerName: 'month' },
+ { field: 'id', width: 120, headerName: 'Month' },
...years.map(j => {
return {
- field: `d${j}`, width: 120, headerName: j,
- valueFormatter: percentageFormatter,
+ field: `d${j}`, width: 10, headerName: j, align: 'right',
+ valueFormatter: percentageFormatter,
type: 'number',
- renderCell: (p) =>
+ renderCell: (p) =>
} as GridColDef
})
]
- return
-
+ Ticker: {props.symbol}
+ ({
},
}}
/>
-
+
}
\ No newline at end of file
diff --git a/src/components/TickerSearchNavigation.tsx b/src/components/TickerSearchNavigation.tsx
index 41f1814..a2cd4cc 100644
--- a/src/components/TickerSearchNavigation.tsx
+++ b/src/components/TickerSearchNavigation.tsx
@@ -1,3 +1,4 @@
+'use client';
import { TickerSearch } from '@/components/TickerSearch';
import { useRouter } from 'next/navigation';