Stale Detection: - Detect skills removed/moved from GitHub (3 consecutive 404s threshold) - Hide stale skills from browse/search, show warning banner on detail page - Serve cached files with isStale flag when GitHub returns 404 - Add stale-check crawler command for batch verification - CLI shows warning when installing stale skills from cache Sentry & Error Handling: - Filter browser extension errors and add denyUrls - Anti-inflation measures and sentinel recalibration for curation Claim & Removal: - Enhanced ClaimForm with repo-level removal support - Add repo-removal-request API endpoint with tests - Improved owner page with bilingual content Review Pipeline: - Review version and reviewer tracking in submit API - Source format filter for pending reviews - Updated review tests Other: - Updated i18n strings (en/fa) - BrowseFilters improvements - Dockerfile updates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
155 lines
5.1 KiB
TypeScript
155 lines
5.1 KiB
TypeScript
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
|
import { Header } from '@/components/Header';
|
|
import { Footer } from '@/components/Footer';
|
|
import { ClaimForm } from '@/components/ClaimForm';
|
|
import { getPageAlternates } from '@/lib/seo';
|
|
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: Promise<{ locale: string }>;
|
|
}) {
|
|
const { locale } = await params;
|
|
return {
|
|
alternates: getPageAlternates(locale, '/claim'),
|
|
};
|
|
}
|
|
|
|
export default async function ClaimPage({
|
|
params,
|
|
}: {
|
|
params: Promise<{ locale: string }>;
|
|
}) {
|
|
const { locale } = await params;
|
|
setRequestLocale(locale);
|
|
const t = await getTranslations('claim');
|
|
|
|
const translations = {
|
|
title: t('title'),
|
|
subtitle: t('subtitle'),
|
|
loginRequired: t('loginRequired'),
|
|
signIn: t('signIn'),
|
|
optional: t('optional'),
|
|
mirror: {
|
|
title: t('mirror.title'),
|
|
description: t('mirror.description'),
|
|
button: t('mirror.button'),
|
|
},
|
|
tabs: {
|
|
remove: t('tabs.remove'),
|
|
add: t('tabs.add'),
|
|
removeRepo: t('tabs.removeRepo'),
|
|
},
|
|
form: {
|
|
skillId: t('form.skillId'),
|
|
skillIdPlaceholder: t('form.skillIdPlaceholder'),
|
|
skillIdHelp: t('form.skillIdHelp'),
|
|
reason: t('form.reason'),
|
|
reasonPlaceholder: t('form.reasonPlaceholder'),
|
|
submit: t('form.submit'),
|
|
submitting: t('form.submitting'),
|
|
},
|
|
addForm: {
|
|
repositoryUrl: t('addForm.repositoryUrl'),
|
|
repositoryUrlPlaceholder: t('addForm.repositoryUrlPlaceholder'),
|
|
repositoryUrlHelp: t('addForm.repositoryUrlHelp'),
|
|
reason: t('addForm.reason'),
|
|
reasonPlaceholder: t('addForm.reasonPlaceholder'),
|
|
submit: t('addForm.submit'),
|
|
submitting: t('addForm.submitting'),
|
|
},
|
|
success: {
|
|
title: t('success.title'),
|
|
description: t('success.description'),
|
|
pendingTitle: t('success.pendingTitle'),
|
|
pendingDescription: t('success.pendingDescription'),
|
|
viewRequests: t('success.viewRequests'),
|
|
},
|
|
addSuccess: {
|
|
title: t('addSuccess.title'),
|
|
description: t('addSuccess.description'),
|
|
descriptionNoSkillMd: t('addSuccess.descriptionNoSkillMd'),
|
|
descriptionMultiplePrefix: t('addSuccess.descriptionMultiplePrefix'),
|
|
descriptionMultipleSuffix: t('addSuccess.descriptionMultipleSuffix'),
|
|
viewRequests: t('addSuccess.viewRequests'),
|
|
foundSkillsIn: t('addSuccess.foundSkillsIn'),
|
|
root: t('addSuccess.root'),
|
|
andMore: t.raw('addSuccess.andMore') as string,
|
|
reEnabledTitle: t('addSuccess.reEnabledTitle'),
|
|
reEnabledDescription: t('addSuccess.reEnabledDescription'),
|
|
},
|
|
removeRepoForm: {
|
|
repoUrl: t('removeRepoForm.repoUrl'),
|
|
repoUrlPlaceholder: t('removeRepoForm.repoUrlPlaceholder'),
|
|
repoUrlHelp: t('removeRepoForm.repoUrlHelp'),
|
|
reason: t('removeRepoForm.reason'),
|
|
reasonPlaceholder: t('removeRepoForm.reasonPlaceholder'),
|
|
submit: t('removeRepoForm.submit'),
|
|
submitting: t('removeRepoForm.submitting'),
|
|
},
|
|
removeRepoSuccess: {
|
|
title: t('removeRepoSuccess.title'),
|
|
description: t.raw('removeRepoSuccess.description') as string,
|
|
descriptionZero: t('removeRepoSuccess.descriptionZero'),
|
|
},
|
|
removeRepoError: {
|
|
notOwner: t('removeRepoError.notOwner'),
|
|
invalidRepo: t('removeRepoError.invalidRepo'),
|
|
parseError: t('removeRepoError.parseError'),
|
|
},
|
|
error: {
|
|
notOwner: t('error.notOwner'),
|
|
skillNotFound: t('error.skillNotFound'),
|
|
alreadyPending: t('error.alreadyPending'),
|
|
githubError: t('error.githubError'),
|
|
invalidSkill: t('error.invalidSkill'),
|
|
invalidUrl: t('error.invalidUrl'),
|
|
invalidRepo: t('error.invalidRepo'),
|
|
rateLimitExceeded: t('error.rateLimitExceeded'),
|
|
networkTimeout: t('error.networkTimeout'),
|
|
generic: t('error.generic'),
|
|
repoBlockedByOwner: t('error.repoBlockedByOwner'),
|
|
},
|
|
myRequests: {
|
|
title: t('myRequests.title'),
|
|
empty: t('myRequests.empty'),
|
|
status: {
|
|
pending: t('myRequests.status.pending'),
|
|
approved: t('myRequests.status.approved'),
|
|
rejected: t('myRequests.status.rejected'),
|
|
indexed: t('myRequests.status.indexed'),
|
|
},
|
|
skillsFoundPrefix: t('myRequests.skillsFoundPrefix'),
|
|
skillsFoundSuffix: t('myRequests.skillsFoundSuffix'),
|
|
showLess: t('myRequests.showLess'),
|
|
showAllPrefix: t('myRequests.showAllPrefix'),
|
|
showAllSuffix: t('myRequests.showAllSuffix'),
|
|
},
|
|
};
|
|
|
|
return (
|
|
<div className="min-h-screen flex flex-col">
|
|
<Header />
|
|
<main className="flex-1">
|
|
<section className="section-header bg-gradient-subtle">
|
|
<div className="container-main text-center">
|
|
<h1 className="hero-title mb-4">{translations.title}</h1>
|
|
<p className="hero-subtitle max-w-2xl mx-auto">{translations.subtitle}</p>
|
|
</div>
|
|
</section>
|
|
|
|
<section className="section bg-surface">
|
|
<div className="container-main max-w-2xl">
|
|
<ClaimForm translations={translations} />
|
|
</div>
|
|
</section>
|
|
</main>
|
|
<Footer />
|
|
</div>
|
|
);
|
|
}
|