import type { Route } from "./+types/home";
import { useEffect, useState } from "react";
import "../../config.json";
const API_URL = process.env.API_URL;
type transaction = { id: number; tier: number; type: string; cost: number };
export function meta({}: Route.MetaArgs) {
return [{ title: "Albion Online Transaction Tracker" }];
}
export default function Home() {
return (
<>
>
);
}
function TransactionTable() {
const [transactions, setTransactions] = useState([]);
useEffect(() => {
fetch(`${API_URL}/transactions`)
.then((response) => response.json())
.then((data) => {console.log(data); setTransactions(data);});
}, [API_URL]);
return (
<>
| Timestamp |
Tier |
Type |
Amount |
{transactions.map((transaction) => (
|
{transaction.tier} |
{transaction.type} |
{transaction.cost} |
))}
>
);
}