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