Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created August 8, 2019 17:17
Show Gist options
  • Save vsavkin/b6e7e63b39dd2fc84f36dae6e0439886 to your computer and use it in GitHub Desktop.
Save vsavkin/b6e7e63b39dd2fc84f36dae6e0439886 to your computer and use it in GitHub Desktop.
export const App = () => {
const [tickets, setTickets] = useState<Ticket[]>([]);
useEffect(() => {
fetch('/api/tickets')
.then(t => t.json())
.then(setTickets);
}, []);
return (
<StyledApp>
<header className="flex">
<h1>Welcome to agent!</h1>
</header>
<main>
{tickets.map(t => (
<p className="ticket flex" key={t.id}>
{t.title}
</p>
))}
<section>
<button>Agent Action</button>
</section>
</main>
</StyledApp>
);
};
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment