import { type ReactNode } from "react";
import { useNavigate, Link } from "react-router-dom";
import { useAuth } from "../contexts/AuthContext";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import Grid from "@mui/material/Grid";
import Alert from "@mui/material/Alert";
import AddIcon from "@mui/icons-material/Add";
import UpdateCard from "../components/UpdateCard";
import MetricsPanel from "../components/MetricsPanel";
import LoadingSkeleton from "../components/LoadingSkeleton";
import { useDashboardData } from "../hooks/useDashboardData";
function LandingView(): ReactNode {
return (
Job Tracker
Track your job applications, interviews, and offers all in one place.
);
}
function DashboardView(): ReactNode {
const navigate = useNavigate();
const { data, loading, error } = useDashboardData();
if (loading) {
return ;
}
return (
Dashboard
{error && (
Failed to load dashboard data: {error}
)}
{data && (
<>
}
onClick={() => navigate("/applications/new")}
>
Create New Job Application
Recent Updates
{data.updates.map((update) => (
))}
{data.updates.length === 0 && (
No updates yet. Create your first job application to get started.
)}
>
)}
);
}
export default function HomePage(): ReactNode {
const { state } = useAuth();
if (!state.isAuthenticated) {
return ;
}
return ;
}