diff --git a/src/components/pages/packages.tsx b/src/components/pages/packages.tsx index 52c5d36..7eeb7ae 100644 --- a/src/components/pages/packages.tsx +++ b/src/components/pages/packages.tsx @@ -141,18 +141,18 @@ const Packages: React.FC = () => { ) : ( - Object.entries(packages).map(([pkgName, pkgInfo]) => { - const firstPackage = Object.values(pkgInfo.Packages)[0]; + packages.map((pkg, i) => { + const firstPackage = pkg.Packages[0]; return (
- {pkgName} + {pkg.Name} {firstPackage.Status} diff --git a/src/components/pages/queue.tsx b/src/components/pages/queue.tsx index 12b49c2..12cf132 100644 --- a/src/components/pages/queue.tsx +++ b/src/components/pages/queue.tsx @@ -144,32 +144,32 @@ const Queue: React.FC = () => { Loading... - ) : Object.keys(packages).length === 0 ? ( + ) : packages.length === 0 ? ( No packages found. ) : ( - Object.entries(packages).map(([pkgName, pkgInfo]) => { + packages.map((pkg) => { return (
- {pkgName} - {pkgInfo.Type} + {pkg.Source.Name} - {pkg.Type} - {pkgInfo.Status} + {pkg.Status}
- {pkgInfo.BuildVersion} + {pkg.BuildVersion}
@@ -177,12 +177,12 @@ const Queue: React.FC = () => {
- {pkgInfo.BuildVersion} + {pkg.BuildVersion}
- {pkgInfo.Status} + {pkg.Status}
); diff --git a/src/hooks/useQueueData.ts b/src/hooks/useQueueData.ts index 62b24e3..4057d88 100644 --- a/src/hooks/useQueueData.ts +++ b/src/hooks/useQueueData.ts @@ -34,13 +34,13 @@ interface PackageData { interface PackagesResponse { total: number; - packages: Record; + packages: QueueData[]; } const usePackageData = () => { const [stats, setStats] = useState(null); const [lastUpdated, setLastUpdated] = useState(''); - const [packages, setQueuePackages] = useState>({}); + const [packages, setQueuePackages] = useState([]); const [totalCount, setTotalCount] = useState(0); const [loading, setLoading] = useState(false); const fetchStatsAttempted = useRef(false); @@ -74,7 +74,7 @@ const usePackageData = () => { setQueuePackages(data.packages); } catch (error) { console.error("Error fetching packages:", error); - setQueuePackages({}); + setQueuePackages([]); setTotalCount(0); } finally { setLoading(false);