From 51bad1718c3bd2614332578e25fb1fe32bb2e7d8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 02:04:46 +0000 Subject: [PATCH] Fix TypeScript errors and create .env file Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> --- app/api/projects/route.ts | 2 +- app/components/About.tsx | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/app/api/projects/route.ts b/app/api/projects/route.ts index 1f6043c..c64262f 100644 --- a/app/api/projects/route.ts +++ b/app/api/projects/route.ts @@ -148,7 +148,7 @@ export async function GET(request: NextRequest) { } catch (error) { // Handle missing database table gracefully if (error instanceof PrismaClientKnownRequestError && error.code === 'P2021') { - if (process.env.NOD-fallbackE_ENV === 'development') { + if (process.env.NODE_ENV === 'development') { console.warn('Project table does not exist. Returning empty result.'); } return NextResponse.json({ diff --git a/app/components/About.tsx b/app/components/About.tsx index 6f0f7ab..27c8960 100644 --- a/app/components/About.tsx +++ b/app/components/About.tsx @@ -8,6 +8,32 @@ import type { JSONContent } from "@tiptap/react"; import RichTextClient from "./RichTextClient"; import CurrentlyReading from "./CurrentlyReading"; +// Type definitions for CMS data +interface TechStackItem { + id: string; + name: string; + url?: string; + icon_url?: string; + sort: number; +} + +interface TechStackCategory { + id: string; + key: string; + icon: string; + sort: number; + name: string; + items: TechStackItem[]; +} + +interface Hobby { + id: string; + key: string; + icon: string; + title: string; + description?: string; +} + const staggerContainer: Variants = { hidden: { opacity: 0 }, visible: { @@ -35,8 +61,8 @@ const About = () => { const locale = useLocale(); const t = useTranslations("home.about"); const [cmsDoc, setCmsDoc] = useState(null); - const [techStackFromCMS, setTechStackFromCMS] = useState(null); - const [hobbiesFromCMS, setHobbiesFromCMS] = useState(null); + const [techStackFromCMS, setTechStackFromCMS] = useState(null); + const [hobbiesFromCMS, setHobbiesFromCMS] = useState(null); useEffect(() => { (async () => { @@ -146,7 +172,7 @@ const About = () => { // Use CMS Hobbies if available, otherwise fallback const hobbies = hobbiesFromCMS - ? hobbiesFromCMS.map((hobby: any) => ({ + ? hobbiesFromCMS.map((hobby: Hobby) => ({ icon: iconMap[hobby.icon] || Code, text: hobby.title })) @@ -154,11 +180,11 @@ const About = () => { // Use CMS Tech Stack if available, otherwise fallback const techStack = techStackFromCMS - ? techStackFromCMS.map((cat: any) => ({ + ? techStackFromCMS.map((cat: TechStackCategory) => ({ key: cat.key, category: cat.name, icon: iconMap[cat.icon] || Code, - items: cat.items.map((item: any) => item.name) + items: cat.items.map((item: TechStackItem) => item.name) })) : techStackFallback;