-
-
Notifications
You must be signed in to change notification settings - Fork 209
/
SimilarUsers.tsx
53 lines (49 loc) · 1.59 KB
/
SimilarUsers.tsx
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
import { useQuery } from "@tanstack/react-query";
import * as React from "react";
import { Helmet } from "react-helmet";
import { Link, useLocation } from "react-router-dom";
import { RouteQuery } from "../../utils/Loader";
export default function SimilarUsers() {
const location = useLocation();
const {
data: { similarUsers },
} = useQuery(RouteQuery(["similar-users"], location.pathname)) as {
data: { similarUsers: string[][] };
};
return (
<div id="similar-users">
<Helmet>
<title>Top Similar Users</title>
</Helmet>
<h2 className="page-title">Top Similar Users</h2>
<p>
Below is a list of the top similar users and how similar they are.
Sometimes this page can show bugs in how we calculate similar users, but
more often it can show that some of our users are behaving in naughty
ways: Sockpuppet accounts and listen spammers. This page should help us
find these bad actors and let us report them.
</p>
<table className="table table-striped">
<tbody>
{similarUsers.length > 0 ? (
similarUsers.map((row, index) => (
<tr>
<td>
<Link to={`/user/${row[0]}/`}>{row[0]}</Link>
</td>
<td>
<Link to={`/user/${row[1]}/`}>{row[1]}</Link>
</td>
<td>{row[2]}</td>
</tr>
))
) : (
<tr>
<td>No similar users to show.</td>
</tr>
)}
</tbody>
</table>
</div>
);
}