feat: now possible to add transactions
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import type { Route } from "./+types/home";
|
||||
import { useEffect, useState } from "react";
|
||||
import "../../config.json";
|
||||
import AddTransaction from "~/components/AddTransaction";
|
||||
|
||||
const API_URL = process.env.API_URL;
|
||||
type transaction = { id: number; tier: number; type: string; cost: number };
|
||||
const API_URL = "http://localhost:2500";
|
||||
type transaction = { id: number; tier: number; enchantment: number, type: string; silver: number; timestamp: number };
|
||||
|
||||
export function meta({}: Route.MetaArgs) {
|
||||
return [{ title: "Albion Online Transaction Tracker" }];
|
||||
@@ -12,6 +13,7 @@ export function meta({}: Route.MetaArgs) {
|
||||
export default function Home() {
|
||||
return (
|
||||
<>
|
||||
<AddTransaction />
|
||||
<TransactionTable />
|
||||
</>
|
||||
);
|
||||
@@ -40,10 +42,10 @@ function TransactionTable() {
|
||||
<tbody>
|
||||
{transactions.map((transaction) => (
|
||||
<tr key={transaction.id}>
|
||||
<td></td>
|
||||
<td>{transaction.tier}</td>
|
||||
<td>{new Date(transaction.timestamp*1000).toLocaleDateString()} {new Date(transaction.timestamp*1000).toLocaleTimeString()}</td>
|
||||
<td>{transaction.tier}.{transaction.enchantment}</td>
|
||||
<td>{transaction.type}</td>
|
||||
<td>{transaction.cost}</td>
|
||||
<td>{transaction.silver}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user