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 41 42 43 44 45 46 47 48 49 50 51 52 53 | 3x 3x 3x 14x 16x 16x 18x 29x 29x | import { List } from "@mui/material";
import { useLiteUsers } from "features/userQueries/useLiteUsers";
import { ListReferencesRes } from "proto/references_pb";
import makeStyles from "utils/makeStyles";
import ReferenceListItem from "./ReferenceListItem";
const useStyles = makeStyles((theme) => ({
referencesList: {
"& > *": {
paddingBlockEnd: theme.spacing(3),
},
width: "100%",
overflow: "hidden",
},
}));
interface ReferenceListProps {
isReceived?: boolean;
referencePages: ListReferencesRes.AsObject[];
referenceUsers: ReturnType<typeof useLiteUsers>["data"];
}
export default function ReferenceList({
isReceived,
referencePages,
referenceUsers,
}: ReferenceListProps) {
const classes = useStyles();
return (
<List className={classes.referencesList}>
{referencePages
.map((page) =>
page.referencesList.map((reference) => {
const userToShow = referenceUsers?.get(
isReceived ? reference.fromUserId : reference.toUserId
);
return userToShow ? (
<ReferenceListItem
key={reference.referenceId}
isReceived
user={userToShow}
reference={reference}
/>
) : null;
})
)
.flat()}
</List>
);
}
|