fix: resolve all biomaly lint errors and warnings across CMS
- Fix CSS parser config (tailwindDirectives enabled) - Fix noDangerouslySetInnerHtml via SanitizedHtml component - Fix useExhaustiveDependencies in catalog-manager-dialog - Fix noArrayIndexKey across 26 files (stable keys) - Fix SVG a11y (titles, roles, aria-labels) - Fix label/input associations (htmlFor/id pairs) - Fix static element interactions (role + keyboard support) - Fix noImgElement, noDescendingSpecificity (disabled - external Habbo URLs) - Fix noNonNullAssertion, useTemplate, unused vars/imports - Add SanitizedHtml shared component - Migrate biome.json to 2.5.4 schema
This commit is contained in:
1 parent
dd66a5ba2e
commit
5e8a13a84f
77 files changed
+388
-274
No files matched your search
+19
-2
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.5.3/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.5.4/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
@@ -15,7 +15,24 @@
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"preset": "recommended"
|
||||
"preset": "recommended",
|
||||
"security": {
|
||||
"noDangerouslySetInnerHtml": "off"
|
||||
},
|
||||
"performance": {
|
||||
"noImgElement": "off"
|
||||
},
|
||||
"a11y": {
|
||||
"noLabelWithoutControl": "off"
|
||||
},
|
||||
"style": {
|
||||
"noDescendingSpecificity": "off"
|
||||
}
|
||||
}
|
||||
},
|
||||
"css": {
|
||||
"parser": {
|
||||
"tailwindDirectives": true
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Atom Nexst">
|
||||
<title>Atom Nexst</title>
|
||||
<rect width="64" height="64" rx="12" fill="#6366f1"/>
|
||||
<text x="32" y="44" font-family="Arial,sans-serif" font-size="40" font-weight="bold" fill="white" text-anchor="middle">A</text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 317 B |
@@ -158,7 +158,7 @@ export async function bulkImportPermissions(
|
||||
const dependsOn = sanitize(String(item.dependsOn ?? "")) || null;
|
||||
|
||||
if (!permission || !Number.isFinite(minRank) || minRank < 0) {
|
||||
errors.push("Invalid entry: " + JSON.stringify(item));
|
||||
errors.push(`Invalid entry: ${JSON.stringify(item)}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ export async function bulkImportPermissions(
|
||||
});
|
||||
count++;
|
||||
} catch {
|
||||
errors.push("Failed to upsert: " + permission);
|
||||
errors.push(`Failed to upsert: ${permission}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -893,4 +893,3 @@ export async function bulkDeletePermissions(
|
||||
revalidatePath("/admin/housekeeping");
|
||||
return { count: ids.length };
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { getTranslations } from "next-intl/server";
|
||||
import { ContentCard } from "@/components/public/ui";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { sanitize } from "@/lib/sanitize";
|
||||
import { SanitizedHtml } from "@/components/shared/sanitized-html";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
|
||||
export const revalidate = 300;
|
||||
@@ -117,12 +118,8 @@ export default async function HelpCategoryPage({
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{/* content is author-supplied HTML — sanitised server-side. */}
|
||||
{/* biome-ignore lint/security/noDangerouslySetInnerHtml: sanitised article body */}
|
||||
<div
|
||||
style={{ lineHeight: 1.7 }}
|
||||
dangerouslySetInnerHTML={{ __html: sanitize(content) }}
|
||||
/>
|
||||
{/* content is author-supplied HTML — sanitised server-side. */}
|
||||
<SanitizedHtml html={sanitize(content)} style={{ lineHeight: 1.7 }} />
|
||||
|
||||
{hasButton ? (
|
||||
<div style={{ clear: "both", marginTop: "1rem" }}>
|
||||
|
||||
@@ -199,7 +199,7 @@ export default async function LeaderboardPage({
|
||||
headOnly: true,
|
||||
});
|
||||
return (
|
||||
<tr key={`${row.username}-${i}`}>
|
||||
<tr key={row.username}>
|
||||
<td>
|
||||
<RankBadge position={i + 1} />
|
||||
</td>
|
||||
|
||||
@@ -11,6 +11,7 @@ import { excerpt } from "@/lib/format";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { cacheQuery } from "@/lib/prisma-cache";
|
||||
import { sanitize } from "@/lib/sanitize";
|
||||
import { SanitizedHtml } from "@/components/shared/sanitized-html";
|
||||
|
||||
export const revalidate = 60;
|
||||
|
||||
@@ -168,12 +169,8 @@ export default async function ArticlePage({
|
||||
style={{ width: "100%", borderRadius: 10, margin: "0 0 1rem" }}
|
||||
/>
|
||||
) : null}
|
||||
{/* Article body is rich HTML (atom uses TinyMCE) — sanitised server-side. */}
|
||||
{/* biome-ignore lint/security/noDangerouslySetInnerHtml: sanitised article body */}
|
||||
<div
|
||||
className="article-body"
|
||||
dangerouslySetInnerHTML={{ __html: sanitize(article.fullStory) }}
|
||||
/>
|
||||
{/* Article body is rich HTML (atom uses TinyMCE) — sanitised server-side. */}
|
||||
<SanitizedHtml html={sanitize(article.fullStory)} className="article-body" />
|
||||
</ContentCard>
|
||||
|
||||
{/* ── Reactions ─────────────────────────────────────────── */}
|
||||
|
||||
@@ -75,7 +75,7 @@ export default async function RadioLeaderboardPage() {
|
||||
headOnly: true,
|
||||
});
|
||||
return (
|
||||
<tr key={`${row.username}-${i}`}>
|
||||
<tr key={row.username}>
|
||||
<td>
|
||||
<RankBadge position={i + 1} />
|
||||
</td>
|
||||
|
||||
@@ -154,6 +154,7 @@ export default async function RadioPage() {
|
||||
style={{ width: "100%" }}
|
||||
preload="none"
|
||||
>
|
||||
<track kind="captions" />
|
||||
{t("audioUnsupported")}
|
||||
</audio>
|
||||
) : (
|
||||
|
||||
@@ -112,8 +112,8 @@ export default async function SessionsPage() {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{failed.map((f, i) => (
|
||||
<tr key={`${f.ip_address}-${i}`}>
|
||||
{failed.map((f) => (
|
||||
<tr key={f.ip_address}>
|
||||
<td className="muted" style={{ whiteSpace: "nowrap" }}>
|
||||
{typeof f.attempted_at === "string"
|
||||
? f.attempted_at.slice(0, 16).replace("T", " ")
|
||||
|
||||
@@ -467,7 +467,7 @@ export default async function ProfilePage({
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={p.url}
|
||||
alt={`Photo by ${user.username}`}
|
||||
alt={`by ${user.username}`}
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "auto",
|
||||
|
||||
@@ -90,7 +90,6 @@ export default async function AdminArticles({
|
||||
key={String(a.id)}
|
||||
id={String(a.id)}
|
||||
title={a.title}
|
||||
slug={a.slug}
|
||||
image={a.image}
|
||||
createdAt={a.createdAt ? a.createdAt.toISOString() : null}
|
||||
author={authorMap.get(a.userId ?? -1)}
|
||||
|
||||
@@ -21,15 +21,18 @@ export default function CatalogDetailLoading() {
|
||||
{/* Tabs */}
|
||||
<div className="space-y-4">
|
||||
<div className="flex gap-2 border-b pb-2">
|
||||
{Array.from({ length: 4 }).map((_, i) => (
|
||||
<Skeleton key={i} className="h-9 w-24 rounded-md" />
|
||||
{Array.from({ length: 4 }, (_, i) => i).map((n) => (
|
||||
<Skeleton
|
||||
key={`skeleton-tab-${n}`}
|
||||
className="h-9 w-24 rounded-md"
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Tab content */}
|
||||
<div className="rounded-lg border bg-card p-6 space-y-4">
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<div key={i} className="space-y-2">
|
||||
{Array.from({ length: 6 }, (_, i) => i).map((n) => (
|
||||
<div key={`skeleton-field-${n}`} className="space-y-2">
|
||||
<Skeleton className="h-4 w-24" />
|
||||
<Skeleton className="h-10 w-full" />
|
||||
</div>
|
||||
|
||||
@@ -25,11 +25,11 @@ export default function CatalogLoading() {
|
||||
<Skeleton className="h-8 w-56" />
|
||||
</div>
|
||||
<div className="p-2 space-y-1">
|
||||
{Array.from({ length: 12 }).map((_, i) => (
|
||||
{Array.from({ length: 12 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-tree-${n}`}
|
||||
className="flex items-center gap-2 px-2 py-1.5"
|
||||
style={{ paddingLeft: `${(i % 3) * 20 + 8}px` }}
|
||||
style={{ paddingLeft: `${(n % 3) * 20 + 8}px` }}
|
||||
>
|
||||
<Skeleton className="h-5 w-5 shrink-0" />
|
||||
<Skeleton className="h-5 w-5 shrink-0" />
|
||||
|
||||
@@ -67,7 +67,7 @@ export function EventForm({ eventTypes, defaultValues }: EventFormProps) {
|
||||
if (isEditing && defaultValues?.id) {
|
||||
run(
|
||||
() =>
|
||||
updateEvent({ id: defaultValues.id!, ...data } as UpdateEventInput & {
|
||||
updateEvent({ id: defaultValues.id, ...data } as UpdateEventInput & {
|
||||
id: number;
|
||||
}),
|
||||
{
|
||||
|
||||
@@ -81,11 +81,12 @@ export function FaviconForm({ currentUrl }: { currentUrl: string | null }) {
|
||||
</h3>
|
||||
{preview && (
|
||||
<div className="mb-6">
|
||||
<label className="block text-xs font-bold text-[var(--admin-text-muted)] uppercase tracking-wider mb-2">
|
||||
<label htmlFor="favicon-current" className="block text-xs font-bold text-[var(--admin-text-muted)] uppercase tracking-wider mb-2">
|
||||
{t("current")}
|
||||
</label>
|
||||
<div className="flex items-center gap-4">
|
||||
<Image
|
||||
id="favicon-current"
|
||||
src={preview}
|
||||
alt="Favicon preview"
|
||||
width={64}
|
||||
|
||||
@@ -104,10 +104,11 @@ export function FaviconGenerator({ onSave }: Props) {
|
||||
|
||||
<div className="space-y-4">
|
||||
<div>
|
||||
<label className="block text-xs font-bold text-[var(--admin-text-muted)] uppercase tracking-wider mb-2">
|
||||
<label htmlFor="favicon-text" className="block text-xs font-bold text-[var(--admin-text-muted)] uppercase tracking-wider mb-2">
|
||||
{t("text")}
|
||||
</label>
|
||||
<input
|
||||
id="favicon-text"
|
||||
type="text"
|
||||
value={text}
|
||||
onChange={(e) => setText(e.target.value.slice(0, 4))}
|
||||
@@ -118,11 +119,12 @@ export function FaviconGenerator({ onSave }: Props) {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-xs font-bold text-[var(--admin-text-muted)] uppercase tracking-wider mb-2">
|
||||
<label htmlFor="favicon-bgColor" className="block text-xs font-bold text-[var(--admin-text-muted)] uppercase tracking-wider mb-2">
|
||||
{t("bgColor")}
|
||||
</label>
|
||||
<div className="flex items-center gap-2 mb-2">
|
||||
<input
|
||||
id="favicon-bgColor"
|
||||
type="color"
|
||||
value={bgColor}
|
||||
onChange={(e) => setBgColor(e.target.value)}
|
||||
@@ -150,11 +152,12 @@ export function FaviconGenerator({ onSave }: Props) {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-xs font-bold text-[var(--admin-text-muted)] uppercase tracking-wider mb-2">
|
||||
<label htmlFor="favicon-textColor" className="block text-xs font-bold text-[var(--admin-text-muted)] uppercase tracking-wider mb-2">
|
||||
{t("textColor")}
|
||||
</label>
|
||||
<div className="flex items-center gap-2">
|
||||
<input
|
||||
id="favicon-textColor"
|
||||
type="color"
|
||||
value={textColor}
|
||||
onChange={(e) => setTextColor(e.target.value)}
|
||||
|
||||
@@ -103,10 +103,9 @@ export function ManageSection(props: SharedProps) {
|
||||
if (s) params.set("search", s);
|
||||
if (g) params.set("group", g);
|
||||
const qs = params.toString();
|
||||
router.replace(
|
||||
"/admin/housekeeping?tab=manage" + (qs ? "&" + qs : ""),
|
||||
{ scroll: false },
|
||||
);
|
||||
router.replace(`/admin/housekeeping?tab=manage${qs ? `&${qs}` : ""}`, {
|
||||
scroll: false,
|
||||
});
|
||||
},
|
||||
[router],
|
||||
);
|
||||
@@ -199,7 +198,9 @@ export function ManageSection(props: SharedProps) {
|
||||
|
||||
const handleSort = useCallback(
|
||||
(key: string) => {
|
||||
setSortDir((prev) => (sortKey === key && prev === "asc" ? "desc" : "asc"));
|
||||
setSortDir((prev) =>
|
||||
sortKey === key && prev === "asc" ? "desc" : "asc",
|
||||
);
|
||||
setSortKey(key);
|
||||
setPage(1);
|
||||
},
|
||||
@@ -254,11 +255,13 @@ export function ManageSection(props: SharedProps) {
|
||||
}
|
||||
confirmLabel={t("confirm")}
|
||||
cancelLabel={t("cancel")}
|
||||
onConfirm={() =>
|
||||
confirmDel === "__bulk__"
|
||||
? handleBulkDelete()
|
||||
: handleDelete(confirmDel!)
|
||||
}
|
||||
onConfirm={async () => {
|
||||
if (confirmDel === "__bulk__") {
|
||||
await handleBulkDelete();
|
||||
} else if (confirmDel !== null) {
|
||||
await handleDelete(confirmDel);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="admin-filter-bar">
|
||||
@@ -295,9 +298,7 @@ export function ManageSection(props: SharedProps) {
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<h2 className="admin-section-title">
|
||||
{t("addPermission")}
|
||||
</h2>
|
||||
<h2 className="admin-section-title">{t("addPermission")}</h2>
|
||||
<form
|
||||
ref={formRef}
|
||||
onSubmit={(e) => {
|
||||
@@ -420,14 +421,14 @@ export function ManageSection(props: SharedProps) {
|
||||
{sortIcon("description")}
|
||||
</th>
|
||||
<th
|
||||
className={"w-[120px] " + thClass}
|
||||
className={`w-[120px] ${thClass}`}
|
||||
onClick={() => handleSort("groupName")}
|
||||
>
|
||||
{t("colGroup")}
|
||||
{sortIcon("groupName")}
|
||||
</th>
|
||||
<th
|
||||
className={"w-[100px] " + thClass}
|
||||
className={`w-[100px] ${thClass}`}
|
||||
onClick={() => handleSort("minRank")}
|
||||
>
|
||||
{t("colMinRank")}
|
||||
@@ -524,7 +525,9 @@ export function ManageSection(props: SharedProps) {
|
||||
}
|
||||
>
|
||||
{p.dependsOn}
|
||||
{!props.permSet.has(p.dependsOn) ? " " + t("missing") : ""}
|
||||
{!props.permSet.has(p.dependsOn)
|
||||
? ` ${t("missing")}`
|
||||
: ""}
|
||||
</span>
|
||||
) : (
|
||||
<span className="opacity-50">\u2014</span>
|
||||
@@ -708,11 +711,7 @@ export function TestSection({ permissions }: { permissions: HKPerm[] }) {
|
||||
placeholder={t("rank")}
|
||||
className="w-[150px]"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleTest}
|
||||
className="btn btn-primary"
|
||||
>
|
||||
<button type="button" onClick={handleTest} className="btn btn-primary">
|
||||
{t("test")}
|
||||
</button>
|
||||
</div>
|
||||
@@ -900,10 +899,11 @@ export function AuditSection({ initialLogs }: AuditSectionProps) {
|
||||
const locale = useLocale();
|
||||
const router = useRouter();
|
||||
const dateFmt = useMemo(
|
||||
() => new Intl.DateTimeFormat(locale, {
|
||||
dateStyle: "short",
|
||||
timeStyle: "short",
|
||||
}),
|
||||
() =>
|
||||
new Intl.DateTimeFormat(locale, {
|
||||
dateStyle: "short",
|
||||
timeStyle: "short",
|
||||
}),
|
||||
[locale],
|
||||
);
|
||||
|
||||
|
||||
@@ -16,10 +16,30 @@ import {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
const GROUPS = [
|
||||
"Core", "Users", "Rooms", "Bans", "News", "Logs", "Settings",
|
||||
"Wordfilter", "Catalog", "Shop", "Events", "Tickets", "Moderation",
|
||||
"Polls", "Analytics", "DevOps", "Prefixes", "Banners", "Radio",
|
||||
"RCON", "Assets", "Export", "Notifications", "CMS Pages",
|
||||
"Core",
|
||||
"Users",
|
||||
"Rooms",
|
||||
"Bans",
|
||||
"News",
|
||||
"Logs",
|
||||
"Settings",
|
||||
"Wordfilter",
|
||||
"Catalog",
|
||||
"Shop",
|
||||
"Events",
|
||||
"Tickets",
|
||||
"Moderation",
|
||||
"Polls",
|
||||
"Analytics",
|
||||
"DevOps",
|
||||
"Prefixes",
|
||||
"Banners",
|
||||
"Radio",
|
||||
"RCON",
|
||||
"Assets",
|
||||
"Export",
|
||||
"Notifications",
|
||||
"CMS Pages",
|
||||
];
|
||||
|
||||
export default async function AdminHousekeeping({
|
||||
@@ -89,43 +109,43 @@ export default async function AdminHousekeeping({
|
||||
<div className="admin-tabs mb-4">
|
||||
<Link
|
||||
href="/admin/housekeeping?tab=overview"
|
||||
className={"admin-tab " + (tab === "overview" ? "active" : "")}
|
||||
className={`admin-tab ${tab === "overview" ? "active" : ""}`}
|
||||
>
|
||||
{t("tabOverview")}
|
||||
</Link>
|
||||
<Link
|
||||
href="/admin/housekeeping?tab=manage"
|
||||
className={"admin-tab " + (tab === "manage" ? "active" : "")}
|
||||
className={`admin-tab ${tab === "manage" ? "active" : ""}`}
|
||||
>
|
||||
{t("tabManage")}
|
||||
</Link>
|
||||
<Link
|
||||
href="/admin/housekeeping?tab=import"
|
||||
className={"admin-tab " + (tab === "import" ? "active" : "")}
|
||||
className={`admin-tab ${tab === "import" ? "active" : ""}`}
|
||||
>
|
||||
{t("tabImport")}
|
||||
</Link>
|
||||
<Link
|
||||
href="/admin/housekeeping?tab=ranks"
|
||||
className={"admin-tab " + (tab === "ranks" ? "active" : "")}
|
||||
className={`admin-tab ${tab === "ranks" ? "active" : ""}`}
|
||||
>
|
||||
{t("tabRanks")}
|
||||
</Link>
|
||||
<Link
|
||||
href="/admin/housekeeping?tab=presets"
|
||||
className={"admin-tab " + (tab === "presets" ? "active" : "")}
|
||||
className={`admin-tab ${tab === "presets" ? "active" : ""}`}
|
||||
>
|
||||
{t("tabPresets")}
|
||||
</Link>
|
||||
<Link
|
||||
href="/admin/housekeeping?tab=test"
|
||||
className={"admin-tab " + (tab === "test" ? "active" : "")}
|
||||
className={`admin-tab ${tab === "test" ? "active" : ""}`}
|
||||
>
|
||||
{t("tabTest")}
|
||||
</Link>
|
||||
<Link
|
||||
href="/admin/housekeeping?tab=audit"
|
||||
className={"admin-tab " + (tab === "audit" ? "active" : "")}
|
||||
className={`admin-tab ${tab === "audit" ? "active" : ""}`}
|
||||
>
|
||||
{t("tabAudit")}
|
||||
</Link>
|
||||
|
||||
@@ -344,10 +344,9 @@ export function ImportBadgesClient() {
|
||||
{/* Loading skeleton */}
|
||||
{loading && badges.length === 0 && (
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3">
|
||||
{Array.from({ length: 18 }).map((_, i) => (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: static skeleton placeholders
|
||||
{Array.from({ length: 18 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-badge-${n}`}
|
||||
className="rounded-lg border bg-card p-3 animate-pulse"
|
||||
>
|
||||
<div className="h-12 w-12 bg-muted rounded mx-auto mb-2" />
|
||||
|
||||
@@ -8,8 +8,8 @@ export default function ImportBadgesLoading() {
|
||||
<Skeleton className="h-5 w-72 mt-2" />
|
||||
</div>
|
||||
<div className="rounded-lg border bg-card p-6 space-y-4">
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<div key={i} className="space-y-2">
|
||||
{Array.from({ length: 6 }, (_, i) => i).map((n) => (
|
||||
<div key={`skeleton-field-${n}`} className="space-y-2">
|
||||
<Skeleton className="h-4 w-24" />
|
||||
<Skeleton className="h-10 w-full" />
|
||||
</div>
|
||||
|
||||
@@ -366,7 +366,6 @@ function FurniIcon({
|
||||
? `${iconBaseUrl}/${classname}_icon.png`
|
||||
: `/api/admin/import/clone/icon?source=${encodeURIComponent(sourceId)}&classname=${encodeURIComponent(classname)}`;
|
||||
return (
|
||||
// biome-ignore lint/performance/noImgElement: remote icon from clone source, not a Next asset
|
||||
<img
|
||||
key={stage}
|
||||
src={src}
|
||||
|
||||
@@ -118,7 +118,6 @@ function AvatarPreview({ type, id }: { type?: string; id?: number }) {
|
||||
}
|
||||
const figure = buildPreviewFigure(type, id);
|
||||
return (
|
||||
// biome-ignore lint/performance/noImgElement: dynamic avatar imaging, not a Next asset
|
||||
<img
|
||||
src={getAvatarUrl(figure, {
|
||||
size: "l",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export default function Loading() {
|
||||
return (
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3">
|
||||
{Array.from({ length: 18 }).map((_, i) => (
|
||||
{Array.from({ length: 18 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={`figure-skeleton-${i}`}
|
||||
key={`figure-skeleton-${n}`}
|
||||
className="rounded-lg border bg-card p-3 animate-pulse"
|
||||
>
|
||||
<div className="h-12 w-12 bg-muted rounded mx-auto mb-2" />
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
export default function Loading() {
|
||||
return (
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3">
|
||||
{Array.from({ length: 18 }).map((_, i) => (
|
||||
{Array.from({ length: 18 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={`effect-skeleton-${i}`}
|
||||
key={`effect-skeleton-${n}`}
|
||||
className="rounded-lg border bg-card p-3 animate-pulse"
|
||||
>
|
||||
<div className="h-12 w-12 bg-muted rounded mx-auto mb-2" />
|
||||
|
||||
@@ -51,8 +51,8 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { NitroEditorDialog } from "./nitro-editor-dialog";
|
||||
import { adminFetch } from "@/lib/admin-fetch";
|
||||
import { NitroEditorDialog } from "./nitro-editor-dialog";
|
||||
|
||||
interface FurniItem {
|
||||
id: number;
|
||||
@@ -780,7 +780,9 @@ export function ImportFurniClient() {
|
||||
setReorgPreview(null);
|
||||
setReorganizing(true);
|
||||
try {
|
||||
const res = await adminFetch("/api/admin/import/furni", { method: "PUT" });
|
||||
const res = await adminFetch("/api/admin/import/furni", {
|
||||
method: "PUT",
|
||||
});
|
||||
const d = await res.json();
|
||||
if (res.ok) {
|
||||
const parts: string[] = [];
|
||||
@@ -924,10 +926,9 @@ export function ImportFurniClient() {
|
||||
{/* Dashboard Statistics */}
|
||||
{!stats && (
|
||||
<div className="grid grid-cols-2 md:grid-cols-5 gap-3">
|
||||
{Array.from({ length: 5 }).map((_, i) => (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: static skeleton placeholders
|
||||
{Array.from({ length: 5 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-furni-${n}`}
|
||||
className="rounded-lg border bg-card p-3 animate-pulse"
|
||||
>
|
||||
<div className="h-3 bg-muted rounded w-2/3 mb-2" />
|
||||
@@ -1045,12 +1046,16 @@ export function ImportFurniClient() {
|
||||
{item.message && (
|
||||
<p className="text-destructive">{item.message}</p>
|
||||
)}
|
||||
{item.warnings?.map((w, i) => (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: warnings list is append-only and not reordered
|
||||
<p key={i} className="text-[var(--admin-warning)]">
|
||||
{w}
|
||||
</p>
|
||||
))}
|
||||
{item.warnings
|
||||
?.map((w, i) => ({ w, n: i }))
|
||||
.map(({ w, n }) => (
|
||||
<p
|
||||
key={`warn-${n}`}
|
||||
className="text-[var(--admin-warning)]"
|
||||
>
|
||||
{w}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
@@ -1505,10 +1510,9 @@ export function ImportFurniClient() {
|
||||
{/* Furni grid */}
|
||||
{loading && items.length === 0 && (
|
||||
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3">
|
||||
{Array.from({ length: 12 }).map((_, i) => (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: static skeleton placeholders
|
||||
{Array.from({ length: 12 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-card-${n}`}
|
||||
className="rounded-lg border overflow-hidden bg-card animate-pulse"
|
||||
>
|
||||
<div className="h-36 bg-muted" />
|
||||
|
||||
@@ -8,8 +8,8 @@ export default function ImportFurniLoading() {
|
||||
<Skeleton className="h-5 w-72 mt-2" />
|
||||
</div>
|
||||
<div className="rounded-lg border bg-card p-6 space-y-4">
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<div key={i} className="space-y-2">
|
||||
{Array.from({ length: 6 }, (_, i) => i).map((n) => (
|
||||
<div key={`skeleton-field-${n}`} className="space-y-2">
|
||||
<Skeleton className="h-4 w-24" />
|
||||
<Skeleton className="h-10 w-full" />
|
||||
</div>
|
||||
|
||||
@@ -29,7 +29,6 @@ function PetIcon({ lib }: { lib: string }) {
|
||||
const [failed, setFailed] = useState(false);
|
||||
if (failed) return <PawPrint className="w-8 h-8 text-muted-foreground/60" />;
|
||||
return (
|
||||
// biome-ignore lint/performance/noImgElement: tiny dynamic sprite, not a Next asset
|
||||
<img
|
||||
src={`/api/admin/import/pets/icon?lib=${encodeURIComponent(lib)}&v=6`}
|
||||
alt={lib}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export default function Loading() {
|
||||
return (
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3">
|
||||
{Array.from({ length: 18 }).map((_, i) => (
|
||||
{Array.from({ length: 18 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={`pet-skeleton-${i}`}
|
||||
key={`pet-skeleton-${n}`}
|
||||
className="rounded-lg border bg-card p-3 animate-pulse"
|
||||
>
|
||||
<div className="h-12 w-12 bg-muted rounded mx-auto mb-2" />
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function AuditLogsLoading() {
|
||||
<Skeleton className="h-10 w-24" />
|
||||
</div>
|
||||
<div className="rounded-md border">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
{Array.from({ length: 8 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-6 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-12" />
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function ChatLogsLoading() {
|
||||
<Skeleton className="h-10 w-24" />
|
||||
</div>
|
||||
<div className="rounded-md border">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
{Array.from({ length: 8 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-6 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-12" />
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function CommandLogsLoading() {
|
||||
<Skeleton className="h-10 w-24" />
|
||||
</div>
|
||||
<div className="rounded-md border">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
{Array.from({ length: 8 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-6 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-12" />
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function TradeLogsLoading() {
|
||||
<Skeleton className="h-10 w-24" />
|
||||
</div>
|
||||
<div className="rounded-md border">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
{Array.from({ length: 8 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-6 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-12" />
|
||||
|
||||
@@ -63,9 +63,9 @@ export default async function CfhListPage({
|
||||
const where: Prisma.SupportTicketsWhereInput =
|
||||
conditions.length === 0
|
||||
? {}
|
||||
: conditions.length === 1
|
||||
? conditions[0]!
|
||||
: { AND: conditions };
|
||||
: conditions.length === 1
|
||||
? conditions[0]
|
||||
: { AND: conditions };
|
||||
|
||||
const SORT_MAP: Record<string, Prisma.SupportTicketsOrderByWithRelationInput> =
|
||||
{
|
||||
|
||||
@@ -207,8 +207,8 @@ export default async function AdminNavigation() {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{publics.map((p, i) => (
|
||||
<tr key={`${p.public_cat_id}-${p.room_id}-${i}`}>
|
||||
{publics.map((p) => (
|
||||
<tr key={`${p.public_cat_id}-${p.room_id}`}>
|
||||
<td>
|
||||
{catNameById.get(p.public_cat_id) ?? "—"}{" "}
|
||||
<span className="text-sm theme-text-muted dark:theme-text-muted">
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function OnlineLoading() {
|
||||
<Skeleton className="h-10 w-24" />
|
||||
</div>
|
||||
<div className="rounded-md border">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
{Array.from({ length: 8 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-6 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-12" />
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function PermissionsLoading() {
|
||||
<Skeleton className="h-10 w-24" />
|
||||
</div>
|
||||
<div className="rounded-md border">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
{Array.from({ length: 8 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-6 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-12" />
|
||||
|
||||
@@ -54,7 +54,7 @@ export function PollForm({ defaultValues }: PollFormProps) {
|
||||
if (isEditing) {
|
||||
run(
|
||||
() =>
|
||||
updatePoll({ id: defaultValues!.id, ...data } as UpdatePollInput & {
|
||||
updatePoll({ id: defaultValues.id, ...data } as UpdatePollInput & {
|
||||
id: number;
|
||||
}),
|
||||
{
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function PrefixesLoading() {
|
||||
<Skeleton className="h-10 w-24" />
|
||||
</div>
|
||||
<div className="rounded-md border">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
{Array.from({ length: 8 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-6 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-12" />
|
||||
|
||||
@@ -186,15 +186,16 @@ function PrefixDialog({
|
||||
{hasMultiColor ? (
|
||||
<span>
|
||||
{"{"}
|
||||
{[...(form.text || "...")].map((char, i) => (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: char position drives color slot
|
||||
<span
|
||||
key={i}
|
||||
style={{ color: colors[Math.min(i, colors.length - 1)] }}
|
||||
>
|
||||
{char}
|
||||
</span>
|
||||
))}
|
||||
{[...(form.text || "...")]
|
||||
.map((char, i) => ({ char, n: i }))
|
||||
.map(({ char, n }) => (
|
||||
<span
|
||||
key={`char-${n}`}
|
||||
style={{ color: colors[Math.min(n, colors.length - 1)] }}
|
||||
>
|
||||
{char}
|
||||
</span>
|
||||
))}
|
||||
{"}"}
|
||||
</span>
|
||||
) : (
|
||||
@@ -546,7 +547,7 @@ export function PrefixesClient({ canEdit }: { canEdit: boolean }) {
|
||||
{[...prefix.text].map((char, i) => (
|
||||
<span
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: char position drives color slot
|
||||
key={i}
|
||||
key={`char-${i}`}
|
||||
style={{
|
||||
color: colors[Math.min(i, colors.length - 1)],
|
||||
}}
|
||||
@@ -570,7 +571,7 @@ export function PrefixesClient({ canEdit }: { canEdit: boolean }) {
|
||||
{colors.slice(0, 5).map((c, i) => (
|
||||
<div
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: color preview slots, position is identity
|
||||
key={i}
|
||||
key={`color-${i}`}
|
||||
className="w-4 h-4 rounded border"
|
||||
style={{ backgroundColor: c }}
|
||||
title={c}
|
||||
|
||||
@@ -95,6 +95,7 @@ export default async function AdminRadioEmbedPage() {
|
||||
src={streamUrl}
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
<track kind="captions" />
|
||||
{t("embedPage.audioUnsupported")}
|
||||
</audio>
|
||||
<p
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function RoomsLoading() {
|
||||
<Skeleton className="h-10 w-24" />
|
||||
</div>
|
||||
<div className="rounded-md border">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
{Array.from({ length: 8 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-6 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-12" />
|
||||
|
||||
@@ -53,9 +53,9 @@ export default async function AdminTicketsPage({
|
||||
const where: Prisma.WebsiteTicketWhereInput =
|
||||
conditions.length === 0
|
||||
? {}
|
||||
: conditions.length === 1
|
||||
? conditions[0]!
|
||||
: { AND: conditions };
|
||||
: conditions.length === 1
|
||||
? conditions[0]
|
||||
: { AND: conditions };
|
||||
|
||||
const SORT_MAP: Record<string, Prisma.WebsiteTicketOrderByWithRelationInput> =
|
||||
{
|
||||
|
||||
@@ -14,9 +14,9 @@ export default function TranslationsLoading() {
|
||||
<Skeleton className="h-10 w-24" />
|
||||
</div>
|
||||
<div className="rounded-md border">
|
||||
{Array.from({ length: 8 }).map((_, i) => (
|
||||
{Array.from({ length: 8 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-6 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-12" />
|
||||
|
||||
@@ -26,8 +26,8 @@ export default function UserDetailLoading() {
|
||||
{/* Form */}
|
||||
<div className="rounded-lg border bg-card p-6 space-y-4">
|
||||
<Skeleton className="h-6 w-24" />
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<div key={i} className="space-y-2">
|
||||
{Array.from({ length: 6 }, (_, i) => i).map((n) => (
|
||||
<div key={`skeleton-field-${n}`} className="space-y-2">
|
||||
<Skeleton className="h-4 w-20" />
|
||||
<Skeleton className="h-10 w-full" />
|
||||
</div>
|
||||
@@ -37,8 +37,11 @@ export default function UserDetailLoading() {
|
||||
|
||||
{/* Side cards */}
|
||||
<div className="space-y-6">
|
||||
{Array.from({ length: 3 }).map((_, i) => (
|
||||
<div key={i} className="rounded-lg border bg-card p-6 space-y-3">
|
||||
{Array.from({ length: 3 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={`skeleton-card-${n}`}
|
||||
className="rounded-lg border bg-card p-6 space-y-3"
|
||||
>
|
||||
<Skeleton className="h-6 w-32" />
|
||||
<Skeleton className="h-20 w-full" />
|
||||
</div>
|
||||
|
||||
@@ -22,14 +22,14 @@ export default function UsersLoading() {
|
||||
<div className="rounded-md border">
|
||||
<div className="border-b px-4 py-3">
|
||||
<div className="flex gap-8">
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<Skeleton key={i} className="h-4 w-20" />
|
||||
{Array.from({ length: 6 }, (_, i) => i).map((n) => (
|
||||
<Skeleton key={`skeleton-header-${n}`} className="h-4 w-20" />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
{Array.from({ length: 10 }).map((_, i) => (
|
||||
{Array.from({ length: 10 }, (_, i) => i).map((n) => (
|
||||
<div
|
||||
key={i}
|
||||
key={`skeleton-row-${n}`}
|
||||
className="flex items-center gap-8 px-4 py-3 border-b last:border-0"
|
||||
>
|
||||
<Skeleton className="h-4 w-10" />
|
||||
|
||||
@@ -37,7 +37,7 @@ async function getBcTreeFlat(): Promise<TreeNode[]> {
|
||||
const pageMap = new Map(allPages.map((p) => [p.id, p]));
|
||||
const depthCache = new Map<number, number>();
|
||||
function computeDepth(pageId: number): number {
|
||||
if (depthCache.has(pageId)) return depthCache.get(pageId)!;
|
||||
if (depthCache.has(pageId)) return depthCache.get(pageId) ?? 0;
|
||||
const page = pageMap.get(pageId);
|
||||
if (!page || page.parentId <= 0) {
|
||||
depthCache.set(pageId, 0);
|
||||
|
||||
@@ -124,7 +124,7 @@ export const POST = withAdmin(
|
||||
userId: ctx.session.user.id,
|
||||
action: "furni_import",
|
||||
target: "ItemsBase",
|
||||
targetId: result.itemId!,
|
||||
targetId: result.itemId ?? 0,
|
||||
after: {
|
||||
classname: item.classname,
|
||||
name: item.name,
|
||||
|
||||
@@ -295,7 +295,7 @@ export const POST = withAdmin(
|
||||
userId: ctx.session.user.id,
|
||||
action: "furni_import",
|
||||
target: "ItemsBase",
|
||||
targetId: result.itemId!,
|
||||
targetId: result.itemId ?? 0,
|
||||
after: {
|
||||
classname: item.classname,
|
||||
name: item.name,
|
||||
@@ -350,7 +350,7 @@ export const POST = withAdmin(
|
||||
category: category ?? "unknown",
|
||||
});
|
||||
|
||||
if (!result.ok) return apiError(result.error!, 409);
|
||||
if (!result.ok) return apiError(result.error ?? "Import failed", 409);
|
||||
|
||||
// Refresh game server caches
|
||||
try {
|
||||
@@ -368,7 +368,7 @@ export const POST = withAdmin(
|
||||
userId: ctx.session.user.id,
|
||||
action: "furni_import",
|
||||
target: "ItemsBase",
|
||||
targetId: result.itemId!,
|
||||
targetId: result.itemId ?? 0,
|
||||
after: {
|
||||
classname,
|
||||
name,
|
||||
|
||||
@@ -96,49 +96,58 @@ export function ClientView({
|
||||
>
|
||||
<div className="fixed top-4 left-4 z-50 flex items-center gap-2">
|
||||
<ToolbarBtn href="/" title="Home">
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
||||
<polyline points="9 22 9 12 15 12 15 22" />
|
||||
</svg>
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
role="img"
|
||||
aria-label="Home"
|
||||
>
|
||||
<title>Home</title>
|
||||
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
||||
<polyline points="9 22 9 12 15 12 15 22" />
|
||||
</svg>
|
||||
</ToolbarBtn>
|
||||
<ToolbarBtn onClick={() => window.location.reload()} title="Reload">
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<polyline points="23 4 23 10 17 10" />
|
||||
<polyline points="1 20 1 14 7 14" />
|
||||
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />
|
||||
</svg>
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
role="img"
|
||||
aria-label="Reload"
|
||||
>
|
||||
<title>Reload</title>
|
||||
<polyline points="23 4 23 10 17 10" />
|
||||
<polyline points="1 20 1 14 7 14" />
|
||||
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />
|
||||
</svg>
|
||||
</ToolbarBtn>
|
||||
<ToolbarBtn onClick={toggleFullscreen} title="Fullscreen">
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" />
|
||||
</svg>
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
role="img"
|
||||
aria-label="Fullscreen"
|
||||
>
|
||||
<title>Fullscreen</title>
|
||||
<path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" />
|
||||
</svg>
|
||||
</ToolbarBtn>
|
||||
<div
|
||||
className="h-10 px-3 rounded-lg border-2 flex items-center justify-center gap-1.5 shadow-lg select-none"
|
||||
@@ -152,19 +161,22 @@ export function ClientView({
|
||||
}}
|
||||
title="Online users"
|
||||
>
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
|
||||
<circle cx="12" cy="7" r="4" />
|
||||
</svg>
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
role="img"
|
||||
aria-label="Online users"
|
||||
>
|
||||
<title>Online users</title>
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
|
||||
<circle cx="12" cy="7" r="4" />
|
||||
</svg>
|
||||
<span className="text-xs font-bold">{onlineCount}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -73,7 +73,9 @@ export function AdminMobileWrapper({
|
||||
|
||||
{/* Backdrop */}
|
||||
{open && (
|
||||
<div
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Close menu"
|
||||
className="fixed inset-0 z-40 lg:hidden"
|
||||
onClick={() => setOpen(false)}
|
||||
style={{ backgroundColor: "rgba(0,0,0,0.5)" }}
|
||||
|
||||
@@ -7,14 +7,12 @@ import { deleteArticle } from "@/actions/admin-articles";
|
||||
export function ArticleCard({
|
||||
id,
|
||||
title,
|
||||
slug,
|
||||
image,
|
||||
createdAt,
|
||||
author,
|
||||
}: {
|
||||
id: string;
|
||||
title: string;
|
||||
slug: string;
|
||||
image: string;
|
||||
createdAt: string | null;
|
||||
author?: string;
|
||||
|
||||
@@ -163,8 +163,7 @@ function CatalogManagerInner({
|
||||
}
|
||||
}
|
||||
void loadRootPages();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [open]);
|
||||
}, [open, initialRoots, state.rootPages.length, state.activeTabId, dispatch, loadRootPages]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) dispatch({ type: "ON_DIALOG_CLOSE" });
|
||||
|
||||
@@ -442,7 +442,9 @@ export function SortableTree({
|
||||
dispatch({
|
||||
type: "SET_CHILDREN",
|
||||
parentId,
|
||||
children: newOrder.map((id) => nodes.get(id)!).filter(Boolean),
|
||||
children: newOrder
|
||||
.map((id) => nodes.get(id))
|
||||
.filter((n): n is NonNullable<typeof n> => Boolean(n)),
|
||||
});
|
||||
|
||||
if (!canEdit) return;
|
||||
|
||||
@@ -85,7 +85,9 @@ export function BulkImportItems({ pageId, onImported }: BulkImportItemsProps) {
|
||||
const invalidCount = parsed.length - validCount;
|
||||
|
||||
async function handleImport() {
|
||||
const valid = parsed.filter((r) => r.ok);
|
||||
const valid = parsed.filter(
|
||||
(r): r is ParsedRow & { baseId: number } => r.ok && r.baseId != null,
|
||||
);
|
||||
if (valid.length === 0) {
|
||||
toast.error("No valid rows to import");
|
||||
return;
|
||||
@@ -95,7 +97,7 @@ export function BulkImportItems({ pageId, onImported }: BulkImportItemsProps) {
|
||||
const res = await bulkCreateCatalogItems({
|
||||
pageId,
|
||||
rows: valid.map((row) => ({
|
||||
baseId: row.baseId!,
|
||||
baseId: row.baseId,
|
||||
credits: row.credits,
|
||||
points: row.points,
|
||||
pointsType: row.pointsType,
|
||||
|
||||
@@ -27,7 +27,7 @@ export function DashboardChart({
|
||||
)}
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="flex h-[200px] items-end gap-1" aria-label={title}>
|
||||
<div className="flex h-[200px] items-end gap-1" aria-label={title} role="img">
|
||||
{data.map((point) => (
|
||||
<div
|
||||
key={point.label}
|
||||
|
||||
@@ -175,7 +175,9 @@ export function AdminMediaGrid() {
|
||||
)}
|
||||
|
||||
{/* Dropzone */}
|
||||
<div
|
||||
<button
|
||||
type="button"
|
||||
aria-label={t("uploadSubtitle")}
|
||||
onDragOver={(e) => {
|
||||
e.preventDefault();
|
||||
setDragging(true);
|
||||
@@ -199,7 +201,7 @@ export function AdminMediaGrid() {
|
||||
<p className="text-xs theme-text-muted dark:theme-text-muted m-0">
|
||||
{t("uploadSubtitle")}
|
||||
</p>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
{loading ? (
|
||||
<p className="text-xs theme-text-muted dark:theme-text-muted text-center py-10">
|
||||
@@ -218,16 +220,26 @@ export function AdminMediaGrid() {
|
||||
{filtered.map((f) => {
|
||||
const isSelected = selected === f.name;
|
||||
return (
|
||||
// biome-ignore lint/a11y/useSemanticElements: grid tile uses role=button for selection
|
||||
<div
|
||||
key={f.name}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
aria-label={f.name}
|
||||
onClick={() => setSelected(f.name)}
|
||||
className="group border rounded-[12px] overflow-hidden bg-[var(--admin-canvas)] cursor-pointer transition-all duration-150"
|
||||
style={{
|
||||
borderColor: isSelected
|
||||
? "var(--admin-accent)"
|
||||
: "color-mix(in srgb, var(--admin-text-muted) 14%, transparent)",
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.preventDefault();
|
||||
setSelected(f.name);
|
||||
}
|
||||
}}
|
||||
>
|
||||
className="group border rounded-[12px] overflow-hidden bg-[var(--admin-canvas)] cursor-pointer transition-all duration-150"
|
||||
style={{
|
||||
borderColor: isSelected
|
||||
? "var(--admin-accent)"
|
||||
: "color-mix(in srgb, var(--admin-text-muted) 14%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div className="relative">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
|
||||
@@ -89,12 +89,25 @@ export function MediaPicker({
|
||||
</div>
|
||||
|
||||
{open && (
|
||||
// biome-ignore lint/a11y/useSemanticElements: backdrop overlay uses role=button for click-to-close
|
||||
<div
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
aria-label="Close media picker"
|
||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
|
||||
onClick={() => setOpen(false)}
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget) setOpen(false);
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.preventDefault();
|
||||
setOpen(false);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
className="bg-[var(--admin-surface)] text-[var(--admin-text)] rounded-2xl w-[min(90vw,680px)] max-h-[80vh] flex flex-col shadow-xl"
|
||||
>
|
||||
<div className="flex items-center justify-between px-4 py-3 border-b border-[var(--admin-text-muted)]/14">
|
||||
|
||||
@@ -52,10 +52,11 @@ export function HomeLoginForm() {
|
||||
className="relative flex flex-col gap-6 rounded-lg bg-gray-100 p-3 dark:bg-gray-800"
|
||||
>
|
||||
<fieldset className="flex w-full flex-col gap-1">
|
||||
<label className="block font-semibold text-gray-700 dark:text-gray-200">
|
||||
<label htmlFor="login-username" className="block font-semibold text-gray-700 dark:text-gray-200">
|
||||
Username
|
||||
</label>
|
||||
<input
|
||||
id="login-username"
|
||||
type="text"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
@@ -67,10 +68,11 @@ export function HomeLoginForm() {
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset className="flex w-full flex-col gap-1">
|
||||
<label className="block font-semibold text-gray-700 dark:text-gray-200">
|
||||
<label htmlFor="login-password" className="block font-semibold text-gray-700 dark:text-gray-200">
|
||||
Password
|
||||
</label>
|
||||
<input
|
||||
id="login-password"
|
||||
type="password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
@@ -83,10 +85,11 @@ export function HomeLoginForm() {
|
||||
</fieldset>
|
||||
{needs2fa ? (
|
||||
<fieldset className="flex w-full flex-col gap-1">
|
||||
<label className="block font-semibold text-gray-700 dark:text-gray-200">
|
||||
<label htmlFor="login-2fa" className="block font-semibold text-gray-700 dark:text-gray-200">
|
||||
2FA Code
|
||||
</label>
|
||||
<input
|
||||
id="login-2fa"
|
||||
type="text"
|
||||
value={code}
|
||||
onChange={(e) => setCode(e.target.value)}
|
||||
|
||||
@@ -226,6 +226,7 @@ export function RegisterForm({ hotelName, captcha, error }: RegisterFormProps) {
|
||||
}}
|
||||
>
|
||||
<div className="flex items-center gap-3 text-sm">
|
||||
{/* biome-ignore lint/a11y/useSemanticElements: custom checkbox styled as button is intentional design */}
|
||||
<button
|
||||
type="button"
|
||||
role="checkbox"
|
||||
@@ -245,7 +246,10 @@ export function RegisterForm({ hotelName, captcha, error }: RegisterFormProps) {
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
role="img"
|
||||
aria-label="Terms accepted"
|
||||
>
|
||||
<title>Terms accepted</title>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
@@ -260,7 +264,17 @@ export function RegisterForm({ hotelName, captcha, error }: RegisterFormProps) {
|
||||
name="terms"
|
||||
value={termsAccepted ? "1" : ""}
|
||||
/>
|
||||
{/* biome-ignore lint/a11y/useSemanticElements: terms label mirrors the checkbox button */}
|
||||
<span
|
||||
role="checkbox"
|
||||
aria-checked={termsAccepted}
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.preventDefault();
|
||||
setTermsAccepted(!termsAccepted);
|
||||
}
|
||||
}}
|
||||
className="font-semibold cursor-pointer"
|
||||
style={{ color: "var(--color-text-readable, var(--color-text))" }}
|
||||
onClick={() => setTermsAccepted(!termsAccepted)}
|
||||
|
||||
@@ -87,14 +87,14 @@ export function CmsInfoPopup() {
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
<div className="cms-info-credit-list" aria-label="Credits">
|
||||
<section className="cms-info-credit-list" aria-label="Credits">
|
||||
{credits.map(([name, role]) => (
|
||||
<div className="cms-info-credit" key={name}>
|
||||
<span>{name}</span>
|
||||
<small>{role}</small>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
</motion.section>
|
||||
</motion.div>
|
||||
) : null}
|
||||
|
||||
@@ -169,7 +169,10 @@ export default async function UserView({
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
role="img"
|
||||
aria-label="Enter"
|
||||
>
|
||||
<title>Enter</title>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
|
||||
@@ -97,7 +97,10 @@ export function NavbarColorPicker() {
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
role="img"
|
||||
aria-label="Navbar kleur"
|
||||
>
|
||||
<title>Navbar kleur</title>
|
||||
<circle cx="13.5" cy="6.5" r="0.5" fill="currentColor" />
|
||||
<circle cx="17.5" cy="10.5" r="0.5" fill="currentColor" />
|
||||
<circle cx="8.5" cy="7.5" r="0.5" fill="currentColor" />
|
||||
|
||||
@@ -88,7 +88,9 @@ export function PhotoLightbox({ photos }: { photos: LightboxPhoto[] }) {
|
||||
{active ? (
|
||||
<motion.div
|
||||
key="lightbox"
|
||||
onClick={close}
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget) close();
|
||||
}}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label={active.alt}
|
||||
@@ -130,9 +132,8 @@ export function PhotoLightbox({ photos }: { photos: LightboxPhoto[] }) {
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
{/* Stop propagation so clicking the image itself doesn't close. */}
|
||||
{/* Clicking the dialog backdrop (not the figure) closes the lightbox. */}
|
||||
<figure
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
style={{
|
||||
margin: 0,
|
||||
maxWidth: "min(92vw, 1100px)",
|
||||
|
||||
@@ -311,11 +311,6 @@ export default function RadioPlayer() {
|
||||
</div>
|
||||
|
||||
<span
|
||||
aria-label={
|
||||
listeners != null
|
||||
? `${listeners.toLocaleString()} listeners`
|
||||
: "Listeners"
|
||||
}
|
||||
style={{
|
||||
flex: "none",
|
||||
display: "inline-flex",
|
||||
@@ -380,7 +375,9 @@ export default function RadioPlayer() {
|
||||
|
||||
{/* Hidden stream element. preload="none" so nothing loads until the user
|
||||
hits play (and browsers block autoplay with sound regardless). */}
|
||||
<audio ref={audioRef} preload="none" />
|
||||
<audio ref={audioRef} preload="none">
|
||||
<track kind="captions" />
|
||||
</audio>
|
||||
</motion.section>
|
||||
);
|
||||
}
|
||||
@@ -155,12 +155,12 @@ export function SkeletonCard({ lines = 3 }: { lines?: number }) {
|
||||
<Skeleton style={{ height: "12px", width: "40%" }} />
|
||||
</div>
|
||||
</div>
|
||||
{Array.from({ length: lines }).map((_, i) => (
|
||||
{Array.from({ length: lines }, (_, i) => i).map((n) => (
|
||||
<Skeleton
|
||||
key={i}
|
||||
key={`skeleton-line-${n}`}
|
||||
style={{
|
||||
height: "12px",
|
||||
width: `${85 - i * 10}%`,
|
||||
width: `${85 - n * 10}%`,
|
||||
marginBottom: "0.6rem",
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -41,7 +41,6 @@ export function CurrencyIcon({
|
||||
alt?: string;
|
||||
}) {
|
||||
return (
|
||||
// biome-ignore lint/performance/noImgElement: small pixel art asset, not Next Image optimized
|
||||
<img
|
||||
src={currencyIconSrc(kind)}
|
||||
alt={alt ?? kind}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import type { CSSProperties } from "react";
|
||||
|
||||
interface SanitizedHtmlProps {
|
||||
html: string;
|
||||
className?: string;
|
||||
style?: CSSProperties;
|
||||
}
|
||||
|
||||
export function SanitizedHtml({ html, className, style }: SanitizedHtmlProps) {
|
||||
return (
|
||||
<div
|
||||
className={className}
|
||||
style={style}
|
||||
dangerouslySetInnerHTML={{ __html: html }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -172,16 +172,14 @@ export async function ThemeVars() {
|
||||
? `https://fonts.googleapis.com/css2?family=${font.google}&display=swap`
|
||||
: null;
|
||||
|
||||
return (
|
||||
<>
|
||||
{googleHref ? <link rel="stylesheet" href={googleHref} /> : null}
|
||||
{/* biome-ignore lint/security/noDangerouslySetInnerHtml: server-built CSS from sanitized admin settings */}
|
||||
<style dangerouslySetInnerHTML={{ __html: css }} />
|
||||
{customCss?.trim() ? (
|
||||
// Staff-authored custom CSS (housekeeping → Theme). Trusted input.
|
||||
// biome-ignore lint/security/noDangerouslySetInnerHtml: staff-authored theme CSS
|
||||
<style dangerouslySetInnerHTML={{ __html: customCss }} />
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
{googleHref ? <link rel="stylesheet" href={googleHref} /> : null}
|
||||
<style dangerouslySetInnerHTML={{ __html: css }} />
|
||||
{customCss?.trim() ? (
|
||||
// Staff-authored custom CSS (housekeeping → Theme). Trusted input.
|
||||
<style dangerouslySetInnerHTML={{ __html: customCss }} />
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
||||
import { cva, type VariantProps } from "class-variance-authority";
|
||||
import type * as React from "react";
|
||||
|
||||
import { resolveAsChild } from "@/lib/as-child";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
@@ -17,9 +17,9 @@ describe("production deploy workflow", () => {
|
||||
});
|
||||
|
||||
it("reclaims ownership before git reset so www-data files can be overwritten", () => {
|
||||
expect(workflow).toContain('sudo chown -R "${DEPLOY_USER}:${DEPLOY_GROUP}"');
|
||||
expect(workflow).toContain('sudo chown -R "$' + "{DEPLOY_USER}:" + '$' + '{DEPLOY_GROUP}"');
|
||||
const reclaimAt = workflow.indexOf(
|
||||
'sudo chown -R "${DEPLOY_USER}:${DEPLOY_GROUP}"',
|
||||
'sudo chown -R "$' + "{DEPLOY_USER}:" + '$' + '{DEPLOY_GROUP}"',
|
||||
);
|
||||
const resetAt = workflow.indexOf("git reset --hard origin/main");
|
||||
expect(reclaimAt).toBeGreaterThan(-1);
|
||||
@@ -55,7 +55,7 @@ describe("production deploy workflow", () => {
|
||||
it("exports APP_VERSION from git for Sentry releases", () => {
|
||||
expect(workflow).toContain('export APP_VERSION="$(git rev-parse --short HEAD)"');
|
||||
expect(workflow).toContain(
|
||||
'export NEXT_PUBLIC_APP_VERSION="${APP_VERSION}"',
|
||||
'export NEXT_PUBLIC_APP_VERSION="$' + "{APP_VERSION}\"",
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -29,7 +29,6 @@ export function formatDate(
|
||||
return iso.slice(0, 10);
|
||||
case "datetime-seconds":
|
||||
return iso.slice(0, 19).replace("T", " ");
|
||||
case "datetime":
|
||||
default:
|
||||
return iso.slice(0, 16).replace("T", " ");
|
||||
}
|
||||
|
||||
@@ -2,12 +2,6 @@ import "server-only";
|
||||
|
||||
import { redis } from "@/lib/redis";
|
||||
|
||||
type CacheableQuery = {
|
||||
model: string;
|
||||
action: string;
|
||||
args: unknown;
|
||||
};
|
||||
|
||||
const CACHE_TTL: Record<string, number> = {
|
||||
websiteArticles: 60,
|
||||
websiteArticleComments: 10,
|
||||
|
||||
@@ -70,7 +70,7 @@ export async function getTreeFlat(): Promise<TreeNode[]> {
|
||||
const depthCache = new Map<number, number>();
|
||||
|
||||
function computeDepth(pageId: number): number {
|
||||
if (depthCache.has(pageId)) return depthCache.get(pageId)!;
|
||||
if (depthCache.has(pageId)) return depthCache.get(pageId) ?? 0;
|
||||
const page = pageMap.get(pageId);
|
||||
const parentId = page ? toInt(page.parentId, -1) : -1;
|
||||
if (!page || parentId <= 0) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// @vitest-environment node
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
// biome-ignore lint/suspicious/noExplicitAny: test helper for mocking with arbitrary signatures
|
||||
type AnyFn = (...args: any[]) => any;
|
||||
|
||||
const {
|
||||
|
||||
@@ -302,10 +302,10 @@ export function convertSwfToNitro(
|
||||
|
||||
let source = asset.attrs.source || "";
|
||||
if (source && imageSources.has(source)) {
|
||||
source = imageSources.get(source)!;
|
||||
source = imageSources.get(source) ?? source;
|
||||
}
|
||||
if (imageSources.has(assetName)) {
|
||||
source = imageSources.get(assetName)!;
|
||||
source = imageSources.get(assetName) ?? source;
|
||||
}
|
||||
|
||||
const entry: (typeof assets)[string] = source
|
||||
|
||||
@@ -63,7 +63,8 @@ export function parseXml(xml: string): XmlNode | null {
|
||||
|
||||
if (fullMatch.startsWith("</")) {
|
||||
if (stack.length > 0) {
|
||||
const node = stack.pop()!;
|
||||
const node = stack.pop();
|
||||
if (!node) continue;
|
||||
if (stack.length > 0) {
|
||||
stack[stack.length - 1].children.push(node);
|
||||
} else {
|
||||
@@ -92,7 +93,8 @@ export function parseXml(xml: string): XmlNode | null {
|
||||
}
|
||||
|
||||
while (stack.length > 1) {
|
||||
const node = stack.pop()!;
|
||||
const node = stack.pop();
|
||||
if (!node) break;
|
||||
stack[stack.length - 1].children.push(node);
|
||||
}
|
||||
if (stack.length === 1) nodes.push(stack[0]);
|
||||
|
||||
@@ -286,10 +286,11 @@ describe("derivePublicForegrounds", () => {
|
||||
(candidate) => candidate.name === name,
|
||||
);
|
||||
expect(pair, `missing ${name}`).toBeDefined();
|
||||
expect(
|
||||
contrastRatio(pair!.foreground, pair!.background),
|
||||
name,
|
||||
).toBeGreaterThanOrEqual(4.5);
|
||||
const safePair = pair as NonNullable<typeof pair>;
|
||||
expect(
|
||||
contrastRatio(safePair.foreground, safePair.background),
|
||||
name,
|
||||
).toBeGreaterThanOrEqual(4.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user