fix: resolve lint warnings - remove unused imports and fix type annotations

This commit is contained in:
2026-04-29 01:47:11 +08:00
parent 7903c9fbbd
commit 133a4a9cc2
2 changed files with 3 additions and 18 deletions
+1 -16
View File
@@ -3,7 +3,7 @@
import { useEffect, useMemo, useState } from "react" import { useEffect, useMemo, useState } from "react"
import Image from "next/image" import Image from "next/image"
import { authClient } from "@/lib/auth-client" import { authClient } from "@/lib/auth-client"
import { Loader2, SearchIcon, BanIcon, UserCheckIcon, ShieldIcon, UsersIcon } from "lucide-react" import { Loader2, SearchIcon, BanIcon, UserCheckIcon, UsersIcon } from "lucide-react"
type Role = "user" | "contributor" | "admin" type Role = "user" | "contributor" | "admin"
@@ -30,21 +30,6 @@ function getInitial(name: string) {
return name?.charAt(0)?.toUpperCase() || "?" return name?.charAt(0)?.toUpperCase() || "?"
} }
function RoleBadge({ role }: { role: Role }) {
const config = {
admin: { bg: "bg-red-500/10", text: "text-red-400", icon: ShieldIcon },
contributor: { bg: "bg-blue-500/10", text: "text-blue-400", icon: UserCheckIcon },
user: { bg: "bg-text/5", text: "text-text/50", icon: UsersIcon },
}[role]
const Icon = config.icon
return (
<span className={`inline-flex items-center gap-1.5 px-2 py-1 rounded-full text-xs font-medium ${config.bg} ${config.text}`}>
<Icon className="h-3 w-3" />
{role.charAt(0).toUpperCase() + role.slice(1)}
</span>
)
}
export function UsersClient() { export function UsersClient() {
const [users, setUsers] = useState<AdminUser[]>([]) const [users, setUsers] = useState<AdminUser[]>([])
const [loading, setLoading] = useState(true) const [loading, setLoading] = useState(true)
+2 -2
View File
@@ -197,8 +197,8 @@ export const gamesListingRoutes = new Elysia({ prefix: "/games/listing" }).get(
// If sorting by benchmarks, re-sort the enriched data // If sorting by benchmarks, re-sort the enriched data
if (sort === "benchmarks") { if (sort === "benchmarks") {
const sortFn = query.order === "asc" const sortFn = query.order === "asc"
? (a: any, b: any) => a.benchmarkCount - b.benchmarkCount ? (a: { benchmarkCount: number }, b: { benchmarkCount: number }) => a.benchmarkCount - b.benchmarkCount
: (a: any, b: any) => b.benchmarkCount - a.benchmarkCount : (a: { benchmarkCount: number }, b: { benchmarkCount: number }) => b.benchmarkCount - a.benchmarkCount
enrichedData.sort(sortFn) enrichedData.sort(sortFn)
} }