mirror of
https://github.com/RSSNext/Folo.git
synced 2026-10-26 02:18:12 +08:00
Share pages only recognized not found errors from ofetch, but the API client throws FollowAPIError, so missing feeds, lists and profiles were served with status 200 and indexed as soft 404s. In the browser the feed page then kept spinning and the list page stayed blank, also when the API failed for another reason. Treat API 404s as not found and pass other API statuses on, and show the not found page or a translated retry view on the feed and list pages, sharing the profile page's view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
772 B
TypeScript
18 lines
772 B
TypeScript
import { Button } from "@follow/components/ui/button/index.jsx"
|
|
import * as React from "react"
|
|
import { useTranslation } from "react-i18next"
|
|
|
|
export const ShareLoadError = ({ title, onRetry }: { title: string; onRetry: () => void }) => {
|
|
const { t } = useTranslation()
|
|
return (
|
|
<div className="mx-auto flex min-h-[60vh] max-w-xl flex-col items-center justify-center px-6 text-center">
|
|
<i className="i-mgc-warning-fill mb-6 size-12 text-orange-500" />
|
|
<h1 className="text-2xl font-semibold text-zinc-900 dark:text-zinc-100">{title}</h1>
|
|
<p className="mt-3 text-zinc-500 dark:text-zinc-400">{t("share.load_error_description")}</p>
|
|
<Button buttonClassName="mt-8" onClick={onRetry}>
|
|
{t("share.retry")}
|
|
</Button>
|
|
</div>
|
|
)
|
|
}
|