diff --git a/src/components/data-tables/cryptos-table.tsx b/src/components/data-tables/cryptos-table.tsx new file mode 100644 index 0000000..dc8d350 --- /dev/null +++ b/src/components/data-tables/cryptos-table.tsx @@ -0,0 +1,86 @@ +'use client' +import * as React from 'react'; +import type {ICryptoInWalletInfo} from "@/interfaces/crypto.interface"; + +import { + type ColumnDef, + flexRender, + getCoreRowModel, + useReactTable, +} from "@tanstack/react-table" +import {DataTable} from "@/components/ui/data-table"; +import {Button} from "@/components/ui/button"; +import {ArrowUpDown, MoreHorizontal} from "lucide-react"; +import {useRouter} from "next/navigation"; +import {useState} from "react"; +import {BuyModal} from "@/components/cryptos/buy-modal"; +import {ViewModal} from "@/components/cryptos/view-modal"; + +interface DataTableProps { + columns: ColumnDef[] + data: TData[] +} + +type Props = { + cryptosArray: ICryptoInWalletInfo[] +}; + +export function CryptosTable(props: Props) { + const router = useRouter() + const cryptos= props.cryptosArray + + const columns: ColumnDef[] = [ + { + accessorKey: "name", + header: "Name", + }, + { + accessorKey: "value", + header: ({ column }) => { + return ( + + ) + }, + }, + { + accessorKey: "quantity", + header: ({ column }) => { + return ( + + ) + }, + }, + { + id: "actions", + cell: ({ row }) => { + const payment = row.original + + return ( +
+ + +
+ ) + }, + }, + ]; + + return ( + <> + + + ); + +} \ No newline at end of file diff --git a/src/components/data-tables/wallet-table.tsx b/src/components/data-tables/wallet-table.tsx new file mode 100644 index 0000000..6b3db92 --- /dev/null +++ b/src/components/data-tables/wallet-table.tsx @@ -0,0 +1,86 @@ +'use client' +import * as React from 'react'; +import type {ICryptoInUserWalletInfo, ICryptoInWalletInfo} from "@/interfaces/crypto.interface"; + +import { + type ColumnDef, + flexRender, + getCoreRowModel, + useReactTable, +} from "@tanstack/react-table" +import {DataTable} from "@/components/ui/data-table"; +import {Button} from "@/components/ui/button"; +import {ArrowUpDown, MoreHorizontal} from "lucide-react"; +import {useRouter} from "next/navigation"; +import {useState} from "react"; +import {BuyModal} from "@/components/cryptos/buy-modal"; +import {ViewModal} from "@/components/cryptos/view-modal"; +import {IUserWallet} from "@/interfaces/userdata.interface"; + +interface DataTableProps { + columns: ColumnDef[] + data: TData[] +} + +type Props = { + walletArray: IUserWallet +}; + +export function WalletTable(props: Props) { + const router = useRouter() + const wallet= props.walletArray.owned_cryptos + + const columns: ColumnDef[] = [ + { + accessorKey: "name", + header: "Name", + }, + { + accessorKey: "value", + header: ({ column }) => { + return ( + + ) + }, + }, + { + accessorKey: "owned_amount", + header: ({ column }) => { + return ( + + ) + }, + }, + { + id: "actions", + cell: ({ row }) => { + const payment = row.original + + return ( +
+

Soon here : Sell, History

+
+ ) + }, + }, + ]; + + return ( + <> + + + ); + +} \ No newline at end of file