Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created August 8, 2019 17:23
Show Gist options
  • Save vsavkin/a38489f01934a7da4ae926aa566b09da to your computer and use it in GitHub Desktop.
Save vsavkin/a38489f01934a7da4ae926aa566b09da to your computer and use it in GitHub Desktop.
import React, { useState, useEffect } from 'react';
import { Ticket } from '@happyorg/data';
import { TicketList } from '@happyorg/ticket-list';
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>
<TicketList tickets={tickets} />
<section>
<p>Agent {agentName.name}</p>
<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