Files
crates/client/src/routes/list.tsx
T
2022-09-16 21:48:14 +10:00

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;