"use client"; import { Search, Grid, List } from "lucide-react"; import { useState } from "react"; import ProblemCard from "@/app/problems/components/ProblemCard"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; import useAction from "@/hook/use-action"; import { getProblems } from "@/modules/problems/actions"; export default function Problems() { const [problems, problemsLoaded, problemsError] = useAction(getProblems); console.log(problems); const [viewMode, setViewMode] = useState<"grid" | "list">("grid"); const difficulties = ["All", "Easy", "Medium", "Hard"]; return (
{/* Header */}

Problems

Choose your battleground. Each run brings you closer to your PB.

{/* Filters */}
{/* Search */}
{/* Category Filter */}
{["Arrays", "Trees", "Graphs", "DP", "Strings"].map((f) => ( {f} ))}
{/* Difficulty Filter */}
{["Easy", "Medium", "Hard"].map((f) => ( {f} ))}
{/* View Toggle */} v && setViewMode(v as "grid" | "list")} >
{/* Problem Grid */}
{problems && problems.map((problem, i) => ( ))}
); }