All files / app/features/connections ConnectionsPage.tsx

0% Statements 0/14
100% Branches 0/0
0% Functions 0/1
0% Lines 0/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40                                                                               
import { Grid, Stack } from "@mui/material";
import HtmlMeta from "components/HtmlMeta";
import PageTitle from "components/PageTitle";
import { CONNECTIONS } from "i18n/namespaces";
import { useTranslation } from "next-i18next";
 
import BlockedUsersList from "./friends/BlockedUsersList";
import FriendList from "./friends/FriendList";
import FriendRequestsReceived from "./friends/FriendRequestsReceived";
import FriendRequestsSent from "./friends/FriendRequestsSent";
import useFriendList from "./friends/useFriendList";
 
function ConnectionsPage() {
  const { t } = useTranslation([CONNECTIONS]);
  const { errors, isLoading, data: friends, refetchFriends } = useFriendList();
 
  return (
    <>
      <HtmlMeta title={t("connections:my_connections")} />
      <PageTitle>{t("connections:my_connections")}</PageTitle>
      {/* Your friends is the main content, so it gets the larger share and the
          rest stack beside it. */}
      <Grid container spacing={2} sx={{ width: "100%", alignItems: "flex-start" }}>
        <Grid size={{ xs: 12, md: 7 }}>
          <FriendList errors={errors} friends={friends} isLoading={isLoading} />
        </Grid>
        <Grid size={{ xs: 12, md: 5 }}>
          <Stack spacing={2}>
            <FriendRequestsReceived />
            <FriendRequestsSent />
            <BlockedUsersList refetchFriends={refetchFriends} />
          </Stack>
        </Grid>
      </Grid>
    </>
  );
}
 
export default ConnectionsPage;