555e282cc4
pi-agent-plugin checks / lint (push) Has been cancelled
pi-agent-plugin checks / test (20) (push) Has been cancelled
pi-agent-plugin checks / test (22) (push) Has been cancelled
pi-agent-plugin checks / build (push) Has been cancelled
TypeScript SDK CI / check_changes (push) Has been cancelled
TypeScript SDK CI / changelog_check (push) Has been cancelled
ci / changelog_check (push) Has been cancelled
ci / check_changes (push) Has been cancelled
ci / build_mem0 (3.10) (push) Has been cancelled
ci / build_mem0 (3.11) (push) Has been cancelled
ci / build_mem0 (3.12) (push) Has been cancelled
CLI Node CI / lint (push) Has been cancelled
CLI Node CI / test (20) (push) Has been cancelled
CLI Node CI / test (22) (push) Has been cancelled
CLI Node CI / build (push) Has been cancelled
CLI Python CI / lint (push) Has been cancelled
CLI Python CI / test (3.10) (push) Has been cancelled
CLI Python CI / test (3.11) (push) Has been cancelled
CLI Python CI / test (3.12) (push) Has been cancelled
CLI Python CI / build (push) Has been cancelled
openclaw checks / lint (push) Has been cancelled
openclaw checks / test (20) (push) Has been cancelled
openclaw checks / test (22) (push) Has been cancelled
openclaw checks / build (push) Has been cancelled
opencode-plugin checks / build (push) Has been cancelled
TypeScript SDK CI / build_ts_sdk (20) (push) Has been cancelled
TypeScript SDK CI / build_ts_sdk (22) (push) Has been cancelled
TypeScript SDK CI / integration_ts_sdk (20) (push) Has been cancelled
TypeScript SDK CI / integration_ts_sdk (22) (push) Has been cancelled
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
"use client";
|
|
import { useEffect } from "react";
|
|
import { useSelector } from "react-redux";
|
|
import { RootState } from "@/store/store";
|
|
import { useAppsApi } from "@/hooks/useAppsApi";
|
|
import { AppCard } from "./AppCard";
|
|
import { AppCardSkeleton } from "@/skeleton/AppCardSkeleton";
|
|
|
|
export function AppGrid() {
|
|
const { fetchApps, isLoading } = useAppsApi();
|
|
const apps = useSelector((state: RootState) => state.apps.apps);
|
|
const filters = useSelector((state: RootState) => state.apps.filters);
|
|
|
|
useEffect(() => {
|
|
fetchApps({
|
|
name: filters.searchQuery,
|
|
is_active: filters.isActive === "all" ? undefined : filters.isActive,
|
|
sort_by: filters.sortBy,
|
|
sort_direction: filters.sortDirection,
|
|
});
|
|
}, [fetchApps, filters]);
|
|
|
|
if (isLoading) {
|
|
return (
|
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
{[...Array(3)].map((_, i) => (
|
|
<AppCardSkeleton key={i} />
|
|
))}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
if (apps.length === 0) {
|
|
return (
|
|
<div className="text-center text-zinc-500 py-8">
|
|
No apps found matching your filters
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
{apps.map((app) => (
|
|
<AppCard key={app.id} app={app} />
|
|
))}
|
|
</div>
|
|
);
|
|
}
|