diff --git a/app/routes/account.$accountId.$appId.logs/components/LogsSideDrawer/LogsSideDrawer.tsx b/app/routes/account.$accountId.$appId.logs/components/LogsSideDrawer/LogsSideDrawer.tsx new file mode 100644 index 000000000..4f6032366 --- /dev/null +++ b/app/routes/account.$accountId.$appId.logs/components/LogsSideDrawer/LogsSideDrawer.tsx @@ -0,0 +1,82 @@ +import { Divider } from "@mantine/core" +import { Card, Drawer, Group, Stack, Text } from "@pokt-foundation/pocket-blocks" +import React from "react" +import { TitledCard } from "~/components/TitledCard" +import { Logs } from "~/models/dwh/sdk" +import { dayjs } from "~/utils/dayjs" + +type LogsSideDrawerProps = { + logsItem?: Logs + onSideDrawerClose: () => void +} + +const LogsSideDrawer = ({ logsItem, onSideDrawerClose }: LogsSideDrawerProps) => { + console.log({ logsItem }) + const cardItems = [ + { + label: "Date", + value: dayjs(logsItem?.ts).format("D MMMM, YYYY"), + }, + { + label: "Time", + value: dayjs(logsItem?.ts).format("h:mm A"), + }, + { + label: "Application ID", + value: logsItem?.portalApplicationId, + }, + { + label: "Chain ID", + value: logsItem?.chainId, + }, + { + label: "Supported method", + value: logsItem?.chainMethod, + }, + { + label: "Error type", + value: logsItem?.errorType, + }, + { + label: "Error name", + value: logsItem?.errorName, + }, + ] + + return ( + + + Summary}> + + + {cardItems.map(({ label, value }, index) => ( + + + {label} {value} + + {index !== cardItems.length - 1 && } + + ))} + + + + + Message}> + + {logsItem?.errorMessage} + + + + + ) +} + +export default LogsSideDrawer diff --git a/app/routes/account.$accountId.$appId.logs/components/LogsSideDrawer/index.ts b/app/routes/account.$accountId.$appId.logs/components/LogsSideDrawer/index.ts new file mode 100644 index 000000000..7ac825737 --- /dev/null +++ b/app/routes/account.$accountId.$appId.logs/components/LogsSideDrawer/index.ts @@ -0,0 +1,3 @@ +import LogsSideDrawer from "./LogsSideDrawer" +export * from "./LogsSideDrawer" +export default LogsSideDrawer diff --git a/app/routes/account.$accountId.$appId.logs/components/LogsTable/LogsTable.tsx b/app/routes/account.$accountId.$appId.logs/components/LogsTable/LogsTable.tsx index 4a77e03ed..ebbbe34eb 100644 --- a/app/routes/account.$accountId.$appId.logs/components/LogsTable/LogsTable.tsx +++ b/app/routes/account.$accountId.$appId.logs/components/LogsTable/LogsTable.tsx @@ -1,6 +1,7 @@ import React, { useState } from "react" import { DataTable } from "~/components/DataTable" import { Logs } from "~/models/dwh/sdk" +import LogsSideDrawer from "~/routes/account.$accountId.$appId.logs/components/LogsSideDrawer" import { dayjs } from "~/utils/dayjs" type LogsTableProps = { @@ -13,6 +14,10 @@ const LogsTable = ({ logs, searchTerm }: LogsTableProps) => { return ( <> + setSelectedLogsItem(undefined)} + /> {