"use client";
import { Tab, Tabs } from "@heroui/react";
import { Responsive } from "react-grid-layout";
import { useEffect, useState, useTransition, useCallback } from "react";
import { useRouter } from "next/navigation";
import dynamic from "next/dynamic";
import { HashLoader } from "react-spinners";
import Paper from "./paper";
import { cn } from "@/lib/utils";
import AvatarTransition from "@/components/avatar";
import { DockDemo } from "@/components/dock-demo";
import { ThemeSwitch } from "@/components/theme-switch";
import MiniPic from "@/components/mini-pic";
import Actions from "@/components/actions";
import { layouts, selectedCard } from "@/config/layout";
import { icons } from "@/config/icons";
import useWindowWidth from "@/hooks/useWindowWidth";
const LoadingPlaceholder = () => (
);
// Lazy load heavy client components with next/dynamic
// These components use browser APIs (WebGL, Mapbox) so ssr: false is required
const IconCloud = dynamic(() => import("@/components/icon-cloud"), {
ssr: false,
loading: LoadingPlaceholder,
});
const MapComponent = dynamic(() => import("@/components/map"), {
ssr: false,
loading: LoadingPlaceholder,
});
// Named export requires .then(mod => mod.Name)
const MiniModel = dynamic(
() => import("@/components/mini").then((mod) => mod.MiniModel),
{
ssr: false,
loading: LoadingPlaceholder,
},
);
// Lazy load for code splitting, but allow SSR (these don't need browser APIs)
const AnimatedEmoji = dynamic(() => import("@/components/animated-emoji"), {
loading: LoadingPlaceholder,
});
const CardStack = dynamic(() => import("@/components/card-stack"), {
loading: LoadingPlaceholder,
});
const WebAgent = dynamic(() => import("@/components/webagent"), {
loading: LoadingPlaceholder,
});
const Chatbot = dynamic(() => import("@/components/chatbot"), {
loading: LoadingPlaceholder,
});
interface HomeClientProps {
photos: string[];
avatarUrl: string;
dogUrl: string;
actionImageUrl: string;
webagentUrl: string;
chatbotUrl: string;
paperUrl: string;
}
export default function HomeClient({
photos,
avatarUrl,
dogUrl,
actionImageUrl,
webagentUrl,
chatbotUrl,
paperUrl,
}: HomeClientProps) {
const { width, settled } = useWindowWidth();
const [tabSelected, setTabSelected] = useState("all");
const [, startTransition] = useTransition();
const router = useRouter();
const [show3D, setShow3D] = useState(false);
const handleMiniClick = useCallback(() => {
setShow3D(true);
}, []);
useEffect(() => {
router.prefetch("/blog");
}, [router]);
return (
{
if (selected === "blog") {
startTransition(() => {
router.push("/blog");
});
return;
}
setTabSelected(selected as string);
}}
>
Hey! I'm Eric, a
SDE at AWS building agentic systems and generative UI. UCLA &
Purdue alum. Passionate about crafting AI experiences that make
life easier. Outside work, I'm hiking with my dog Bert and
planning to summit Mount Rainier in 2027!
{show3D ? (
) : (
)}
);
}