1
0
Fork 0
This repository has been archived on 2023-12-03. You can view files and clone it, but cannot push or open issues or pull requests.
chellaris-galaxy-political-.../components/tables/empires.tsx

21 lines
378 B
TypeScript

'use client';
import useSWR from "swr";
const fetcher = async (url:any) => await fetch(url).then((res) => res.json());
export const EmpireStats = () => {
const {data} = useSWR('/api/empires',fetcher);
let ret;
if (data) {
ret = (
<div className="text-blue-600">{data.empireCount} Empires</div>
)
}
else {
ret = (<div></div>)
}
return ret
}