@@ -12,7 +12,7 @@ export default function ProjectsPage() {
|
||||
const [search, setSearch] = useState("");
|
||||
const [showNew, setShowNew] = useState(false);
|
||||
|
||||
const { data, isLoading } = useQuery({
|
||||
const { data, isLoading, isError } = useQuery({
|
||||
queryKey: ["projects", search],
|
||||
queryFn: async () => {
|
||||
const res = await fetch(`/api/projects?q=${encodeURIComponent(search)}`);
|
||||
@@ -80,6 +80,11 @@ export default function ProjectsPage() {
|
||||
<div className="flex justify-center py-12">
|
||||
<Loader2 className="h-6 w-6 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
) : isError ? (
|
||||
<div className="text-center py-12 text-muted-foreground">
|
||||
<p>Could not load projects.</p>
|
||||
<p className="text-xs mt-2">Check server logs and database connectivity, then refresh.</p>
|
||||
</div>
|
||||
) : projects.length === 0 ? (
|
||||
<div className="text-center py-12 text-muted-foreground">
|
||||
<p>No projects found.</p>
|
||||
|
||||
Reference in New Issue
Block a user