29 lines
536 B
TypeScript
29 lines
536 B
TypeScript
import { h } from 'preact';
|
|
|
|
import { useSelector } from 'react-redux'
|
|
import { State } from './../store'
|
|
|
|
import Want from './../components/want';
|
|
|
|
interface Props {
|
|
user: any,
|
|
wants: any[],
|
|
getUserOffers: (userId: string) => void,
|
|
}
|
|
|
|
const List = ({ user }: Props) => {
|
|
const wants = useSelector((state: State) => state.wants);
|
|
|
|
if (!wants.length) {
|
|
return <div> loading... </div>;
|
|
}
|
|
|
|
return (
|
|
<div class="list">
|
|
{wants.map(Want)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default List;
|