mirror of
https://github.com/Xevion/vastly.git
synced 2025-12-09 18:08:59 -06:00
34 lines
775 B
TypeScript
34 lines
775 B
TypeScript
import Offer from "@components/Offer";
|
|
import { Search } from "@wails/go/main/App";
|
|
import { api } from "@wails/go/models";
|
|
import { useEffect, useState } from "react";
|
|
|
|
function App() {
|
|
const [state, setState] = useState<api.ScoredOffer[] | null>(null);
|
|
|
|
async function invoke() {
|
|
const offers = await Search();
|
|
console.log({ offer: offers[0] });
|
|
offers.sort((a, b) => b.Score - a.Score);
|
|
setState(offers);
|
|
}
|
|
|
|
useEffect(() => {
|
|
if (state === null) invoke();
|
|
});
|
|
|
|
return (
|
|
<div id="App">
|
|
<div className="p-4">
|
|
<div className="space-y-3 flex flex-col justify-items-center">
|
|
{state?.map((offer) => (
|
|
<Offer offer={offer} />
|
|
))}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default App;
|