import { h } from 'preact'; import { useState, useEffect } from 'preact/hooks'; // import style from './style.less'; import actions from './../actions'; import Bundle from './../components/bundle'; interface Props { user: any, offers: any[], getUserOffers: (userId: string) => void, } const User = ({ user }: Props) => { const [offers, setOffers] = useState([]); useEffect(() => { async function getWants() { const [error, wants] = await actions.getWants(); if (error) return console.error(error); setOffers(wants); } getWants(); }, []); if (!offers.length) { return (