Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const imageEventsContainer = (edgeDevice) => {
//const { edgeDevice} = props;
const { loading, payload, error, query } = useQuery(fetchImageEvents(edgeDevice), false);
let isLoading = loading;
const isError = error;
const reload = query;
if (payload === undefined) isLoading = true;
let capturetime = "";
let imgSrc = "";
let newOutOfStockItems = 0;
if (payload !== undefined) {
imgSrc = payload.body.dest_img;
newOutOfStockItems = payload.body.result.num_detections;
capturetime = payload.capturetime;
}
const Users = () => {
const { loading, payload, error, query } = useQuery(action, true);
return (
<div>
{loading && <span>Loading</span>}
{error && <span>Error</span>}
{!loading &&
payload &&
payload.map((user, index) => (
<span>
{index + 1} - {user.firstName} <br>
<br>
</span>
))}
</div>
export const UsersListContainer = () => {
const { loading, payload, error, query } = useQuery(fetchUsersList);
return ;
};