Brighter background color, rearranging of elementes + empire count
This commit is contained in:
parent
3e27047561
commit
6e07d6c564
3 changed files with 38 additions and 4 deletions
components/tables
21
components/tables/empires.tsx
Normal file
21
components/tables/empires.tsx
Normal file
|
@ -0,0 +1,21 @@
|
|||
'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
|
||||
}
|
Reference in a new issue