"use client" import { useState } from "react" import Image from "next/image" import { useRouter } from "next/navigation" import { AnimatePresence, motion } from "motion/react" import { useSession } from "@/lib/auth-client" import type { GameSettingCategory } from "@/lib/db/schema/performanceEntries" import { ThumbsUpIcon, ThumbsDownIcon, FlagIcon, TrashIcon, ChevronLeftIcon, ChevronRightIcon, ShieldCheckIcon, XIcon, UserIcon, ShareIcon, PencilIcon, } from "lucide-react" import { TiptapRenderer } from "@/components/tiptap-renderer" import { ScreenshotLightbox } from "@/components/ui/screenshot-lightbox" type TabKey = "details" | "media" | "settings" | "notes" interface Preset { id: string gameId?: string hardwareSlug: string hardwareName: string upvotes: number downvotes: number settingsJson: GameSettingCategory[] | null settingsCount: number fpsAvg: number | null fpsLow: number | null fpsHigh: number | null fpsOnePercentLow: number | null upscalerType: string | null upscalerVersion: string | null frameGenMethod: string | null protonVersion: string | null osVersion: string | null launchOptions: string | null loadTimeSsd: number | null loadTimeSd: number | null tdpWatts: number | null youtubeVideoId: string | null screenshots: Array<{ id: string url: string width: number height: number }> | null hardwareWattHours: number | null hardwareDeviceType: string | null customSystem: boolean userNotes: string | null userId: string userName: string | null userImage: string | null verifiedAt: string | null isPinned: boolean pinnedAt: string | null createdAt: string versionString: string | null buildId: string | null gameAntiCheatName: string | null gameAntiCheatStatus: "none" | "supported" | "unsupported" | "unknown" | null } interface PresetDetailModalProps { preset: Preset gameId: string gameSource: string gameSteamAppId: number | null gameSlug: string | null onClose: () => void onDelete: (presetId: string) => void onReport: ( presetId: string, reason: "inaccurate" | "spam" | "inappropriate" | "other", details?: string, ) => void hasReported: boolean } function formatDate(value: string | null): string { if (!value) return "—" return new Date(value).toLocaleDateString() } function formatValue(value: string | number | boolean): string { if (typeof value === "boolean") return value ? "On" : "Off" return String(value) } function MetaItem({ label, value, }: { label: string value: React.ReactNode | string | null }) { return (
No media available
| Setting | Value |
|---|---|
| { setting.title } | {formatValue( setting.value, )} |
No settings data