revite/src/context/intermediate/popovers/PendingRequests.tsx

32 lines
843 B
TypeScript
Raw Normal View History

2021-07-02 13:00:17 -04:00
import styles from "./UserPicker.module.scss";
2021-07-05 06:23:23 -04:00
import { Text } from "preact-i18n";
2021-07-02 13:00:17 -04:00
import Modal from "../../../components/ui/Modal";
2021-07-05 06:23:23 -04:00
2021-07-02 13:00:17 -04:00
import { Friend } from "../../../pages/friends/Friend";
2021-07-05 06:23:23 -04:00
import { useUsers } from "../../revoltjs/hooks";
2021-07-02 13:00:17 -04:00
interface Props {
2021-07-05 06:25:20 -04:00
users: string[];
onClose: () => void;
2021-07-02 13:00:17 -04:00
}
export function PendingRequests({ users: ids, onClose }: Props) {
2021-07-05 06:25:20 -04:00
const users = useUsers(ids);
2021-07-02 13:00:17 -04:00
2021-07-05 06:25:20 -04:00
return (
<Modal
visible={true}
title={<Text id="app.special.friends.pending" />}
onClose={onClose}>
<div className={styles.list}>
{users
.filter((x) => typeof x !== "undefined")
.map((x) => (
<Friend user={x!} key={x!._id} />
))}
</div>
</Modal>
);
2021-07-02 13:00:17 -04:00
}