refactor(cms): deduplicate shared admin components and fix studio batch completion
CI / check (push) Failing after 1m35s
CI / deploy (push) Skipped
CI / e2e (push) Skipped

- fix(studio): stop markBatchDone infinite recursion so batches complete
- refactor(api): merge api-response into api and drop the duplicate module
- refactor(media): extract shared media loader and URL validator
- refactor(ui): extract shared LoadingSpinner for site and admin groups
- refactor(dates): consolidate raw date formatting into formatDate util
- refactor(logs): share a single generic log-list loader across tables
- refactor(theme): merge both ColorField components and reuse contrast helpers
- refactor(import): extract shared ImportErrorBanner and SearchInput
- chore(): remove dead theme-editor-tabs after inlining tab components
This commit is contained in:
openhands committed 2026-09-05 20:58:42 +02:00
1 parent b12e405b34
commit 8c12fc6c60
93 files changed
+1447 -1005

No files matched your search

@@ -34,6 +34,7 @@ import {
} from "@/components/ui/select";
import { Textarea } from "@/components/ui/textarea";
import { useServerAction } from "@/hooks/use-server-action";
import { formatDate } from "@/lib/format-date";
const CFH_STATES: Record<number, { label: string; class: string }> = {
0: {
@@ -130,7 +131,7 @@ export function CfhDetail({
</div>
<h1 className="text-xl font-bold">Call For Help Report</h1>
<p className="text-xs text-muted-foreground">
{new Date(ticket.timestamp * 1000).toLocaleString()} · Room #
{formatDate(new Date(ticket.timestamp * 1000))} · Room #
{ticket.roomId}
</p>
</div>
@@ -317,7 +318,7 @@ export function CfhDetail({
<p className="font-medium">{ban.reason || "No reason"}</p>
<p className="text-muted-foreground">
{ban.type} · by {ban.staff} ·{" "}
{new Date(ban.timestamp * 1000).toLocaleDateString()}
{formatDate(new Date(ban.timestamp * 1000), "date")}
</p>
</div>
))}
@@ -431,9 +432,7 @@ export function CfhDetail({
<CardContent className="space-y-2 text-xs text-muted-foreground">
<div className="flex justify-between">
<span>Created</span>
<span>
{new Date(ticket.timestamp * 1000).toLocaleString()}
</span>
<span>{formatDate(new Date(ticket.timestamp * 1000))}</span>
</div>
<div className="flex justify-between">
<span>Room</span>
+2 -1
View File
@@ -12,6 +12,7 @@ import {
User,
WebsiteTicket,
} from "@/lib/db";
import { formatDate } from "@/lib/format-date";
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
export default async function ModTeamPage() {
@@ -169,7 +170,7 @@ export default async function ModTeamPage() {
{member.online === "1"
? "Online"
: member.lastOnline
? new Date(member.lastOnline * 1000).toLocaleDateString()
? formatDate(new Date(member.lastOnline * 1000), "date")
: "—"}
</span>
</Link>