mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-15 17:53:25 +01:00
* fix(frontend): use github-versions.json for version display - Update AppVersion type to match new format with slug field - Switch from versions.json to github-versions.json API - Simplify version matching by direct slug comparison - Remove 'Loading versions...' text - show nothing if no version found * feat(frontend): show tooltip for pinned versions * fix(api): add github-versions endpoint and fix legacy versions route
18 lines
427 B
TypeScript
18 lines
427 B
TypeScript
"use client";
|
|
|
|
import { useQuery } from "@tanstack/react-query";
|
|
|
|
import type { AppVersion, GitHubVersionsResponse } from "@/lib/types";
|
|
|
|
import { fetchVersions } from "@/lib/data";
|
|
|
|
export function useVersions() {
|
|
return useQuery<AppVersion[]>({
|
|
queryKey: ["versions"],
|
|
queryFn: async () => {
|
|
const response: GitHubVersionsResponse = await fetchVersions();
|
|
return response.versions ?? [];
|
|
},
|
|
});
|
|
}
|