diff --git a/apps/journal/app/components/CollectionPage.tsx b/apps/journal/app/components/CollectionPage.tsx new file mode 100644 index 0000000..08c8bab --- /dev/null +++ b/apps/journal/app/components/CollectionPage.tsx @@ -0,0 +1,85 @@ +import { useTranslation } from "react-i18next"; + +interface Entry { + username: string; + displayName: string | null; + domain: string; +} + +interface Props { + kind: "followers" | "following"; + user: { username: string; displayName: string | null }; + entries: Entry[]; + page: number; + total: number; +} + +const PAGE_SIZE = 50; + +export function CollectionPage({ kind, user, entries, page, total }: Props) { + const { t } = useTranslation("journal"); + const totalPages = Math.max(1, Math.ceil(total / PAGE_SIZE)); + const heading = t(`social.${kind}.heading`, { + user: user.displayName ?? user.username, + }); + + return ( +
{t(`social.${kind}.count`, { count: total })}
+ + {entries.length === 0 ? ( ++ {t(`social.${kind}.empty`)} +
+ ) : ( +{error}
} +{t("social.feed.empty")}
+ + {t("social.feed.publicFeedLink")} + +/users/<you>
and on search engines that index those pages.
+ public / private,
+ default public): a separate switch from content
+ visibility. private 404s your profile page and makes
+ you unfollowable; you can still post public content
+ reachable by direct URL. Change anytime in account settings.
+ /users/<you>/followers and
+ /users/<you>/following pages, mirroring
+ Mastodon-style conventions. Set your profile to{" "}
+ private to be unfollowable.
+ {bio.length}/160
+{user.bio}
} +