updated table, began symbol pages

This commit is contained in:
2024-03-11 21:01:49 -04:00
parent 3d1d4913d2
commit e80a8fa031
5 changed files with 98 additions and 44 deletions
-39
View File
@@ -1,39 +0,0 @@
"use client";
import { ResponsiveTreeMap } from "@nivo/treemap";
import { heatmapData as data } from "../MockData/MockData";
export default function page() {
return (
<div className="flex h-96 w-[500px] rounded-md">
<div className="flex flex-col flex-grow bg-neutral-800 rounded-lg">
<div className="flex justify-between px-2 py-2 pb-0">
<div className="flex items-center text-lg px-2">Heatmap</div>
</div>
<div className="flex-grow w-full">
<ResponsiveTreeMap
data={data}
identity="name"
value="loc"
valueFormat=".02s"
tile="binary"
// margin={{ top: 10, right: 10, bottom: 10, left: 10 }}
labelSkipSize={30}
labelTextColor="black"
parentLabelPosition="left"
parentLabelTextColor={{
from: "color",
modifiers: [["darker", 2]],
}}
colors={{ scheme: "red_yellow_green" }}
borderColor={{
from: "color",
modifiers: [["brighter", 0.1]],
}}
motionConfig="wobbly"
/>
</div>
</div>
</div>
);
}
+7
View File
@@ -0,0 +1,7 @@
import React from "react";
const page = () => {
return <div>hello!</div>;
};
export default page;
+81
View File
@@ -0,0 +1,81 @@
"use client";
import {
ColumnDef,
flexRender,
getCoreRowModel,
useReactTable,
} from "@tanstack/react-table";
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
interface TableNoHeaderProps<TData, TValue> {
columns: ColumnDef<TData, TValue>[];
data: TData[];
}
export function TableNoHeader<TData, TValue>({
columns,
data,
}: TableNoHeaderProps<TData, TValue>) {
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
});
return (
<div className="h-full">
<Table className="h-full no-scrollbar">
{/* <TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {
return (
<TableHead key={header.id}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext()
)}
</TableHead>
);
})}
</TableRow>
))}
</TableHeader> */}
<TableBody>
{table.getRowModel().rows?.length ? (
table.getRowModel().rows.map((row) => (
<TableRow
key={row.id}
data-state={row.getIsSelected() && "selected"}
className="text-sm text-white 2xl:text-base border-neutral-700"
>
{row.getVisibleCells().map((cell) => (
<TableCell key={cell.id} className="p-1 pl-4 overflow-hidden">
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</TableCell>
))}
</TableRow>
))
) : (
<TableRow>
<TableCell colSpan={columns.length} className="h-24 text-center">
No results.
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
</div>
);
}
@@ -13,17 +13,21 @@ export const documentsColumns: ColumnDef<documentsDataType>[] = [
return <Badge variant={"secondary"}>{symbol}</Badge>; return <Badge variant={"secondary"}>{symbol}</Badge>;
}, },
enableResizing: false,
}, },
{ {
accessorKey: "title", accessorKey: "title",
header: "Document", header: "Document",
enableResizing: true,
}, },
{ {
accessorKey: "type", accessorKey: "type",
header: "Filing", header: "Filing",
enableResizing: false,
}, },
{ // {
accessorKey: "date", // accessorKey: "date",
header: "Date", // header: "Date",
}, // enableResizing: false,
// },
]; ];
+2 -1
View File
@@ -44,6 +44,7 @@ import { ResponsiveTimeRange } from "@nivo/calendar";
import CalendarSquares from "../charts/CalendarSquares"; import CalendarSquares from "../charts/CalendarSquares";
import { DocumentsTable } from "../charts/documents/DocumentsTable"; import { DocumentsTable } from "../charts/documents/DocumentsTable";
import { documentsColumns } from "../charts/documents/documentsColumns"; import { documentsColumns } from "../charts/documents/documentsColumns";
import { TableNoHeader } from "../Table";
export const PortfolioModule = () => { export const PortfolioModule = () => {
const portfolioLine: LineSeriesPartialOptionsWithData = { const portfolioLine: LineSeriesPartialOptionsWithData = {
@@ -250,7 +251,7 @@ export const EarningsModule = () => {
export const DocumentsModule = () => { export const DocumentsModule = () => {
return ( return (
<HomepageModule title="Documents"> <HomepageModule title="Documents">
<DocumentsTable data={documentsList} columns={documentsColumns} /> <TableNoHeader data={documentsList} columns={documentsColumns} />
</HomepageModule> </HomepageModule>
); );
}; };