import React from 'react' import { Head, usePage } from '@inertiajs/react' import CollectionCard from '../../components/profile/collections/CollectionCard' import ShareToast from '../../components/ui/ShareToast' function getCsrfToken() { if (typeof document === 'undefined') return '' return document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') || '' } async function requestJson(url, { method = 'POST', body } = {}) { const response = await fetch(url, { method, credentials: 'same-origin', headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'X-CSRF-TOKEN': getCsrfToken(), 'X-Requested-With': 'XMLHttpRequest', }, body: body ? JSON.stringify(body) : undefined, }) const payload = await response.json().catch(() => ({})) if (!response.ok) { throw new Error(payload?.message || 'Request failed.') } return payload } function isoToLocalInput(value) { if (!value) return '' const date = new Date(value) if (Number.isNaN(date.getTime())) return '' const local = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) return local.toISOString().slice(0, 16) } function titleize(value) { return String(value || '') .split('_') .filter(Boolean) .map((part) => part.charAt(0).toUpperCase() + part.slice(1)) .join(' ') } function Field({ label, help, children }) { return ( ) } function StatCard({ label, value, tone = 'sky' }) { const toneClasses = { sky: 'border-sky-300/15 bg-sky-400/10 text-sky-100', amber: 'border-amber-300/15 bg-amber-400/10 text-amber-100', emerald: 'border-emerald-300/15 bg-emerald-400/10 text-emerald-100', } return (
Staff Programming
Manage program assignments, preview live pools, and run targeted diagnostics before collections hit discovery surfaces.
{notice ?{notice}
: null}Merge Queue
Review what still needs merge attention and what staff already resolved. Each row links back into the collection studio for full compare-and-confirm actions.
Needs Review
Source
{item.source ?Candidate
{item.target ?Recent Decisions
{item.summary}
: null}{item.updated_at ? new Date(item.updated_at).toLocaleString() : 'Unknown time'}{item.actor?.username ? ` • @${item.actor.username}` : ''}
Diagnostics
Operations summary
Generated {new Date(observabilitySummary.generated_at).toLocaleString()}
: null}Watchlist
{Array.isArray(observabilitySummary?.watchlist) && observabilitySummary.watchlist.length ? (No watchlist items are currently flagged.
}Eligibility
{diagnostics.eligibility ? ({diagnostics.eligibility.status === 'queued' ? `${diagnostics.eligibility.count} collection(s) queued.` : `${diagnostics.eligibility.count} collection(s) evaluated.`}
{diagnostics.eligibility.message ?Run an eligibility refresh to verify readiness and public placement safety.
}Duplicate candidates
{diagnostics.duplicates ? ({diagnostics.duplicates.status === 'queued' ? `${diagnostics.duplicates.count} collection(s) queued.` : `${diagnostics.duplicates.count} collection(s) with candidates.`}
{diagnostics.duplicates.message ?Run duplicate scan to surface overlap before programming a collection widely.
}Recommendation refresh
{diagnostics.recommendations ? ({diagnostics.recommendations.status === 'queued' ? `${diagnostics.recommendations.count} collection(s) queued.` : `${diagnostics.recommendations.count} collection(s) refreshed.`}
{diagnostics.recommendations.message ?Run a recommendation refresh to update ranking and search tiers for this collection.
}Assignments