+ {[
+ {
+ id: user?.id,
+ name: user?.name ?? null,
+ image: user?.image ?? null,
+ handle: user?.handle ?? null,
+ },
+ ] // myself first
+ .concat(
+ data?.entries.entryReadHistories.users.filter(
+ (u) => u.id !== user?.id,
+ ) ?? [],
+ ) // then others
+ .slice(0, 10) // only show 10
+ .concat(
+ data?.entries.entryReadHistories.readCount &&
+ data.entries.entryReadHistories.readCount > 10 ?
+ [
+ {
+ id: "more",
+ name: `+${
+ data?.entries.entryReadHistories.readCount - 10
+ }`,
+ image: null,
+ handle: null,
+ },
+ ] :
+ [],
+ ) // show more count
+ .map((user, i) => (
+
+
+
+
+
+
+ {user.name?.slice(0, 2)}
+
+
+
+
+ {user.name}
+
+ ))}
+