import { useInfiniteQuery } from '@tanstack/react-query'; import axios from 'axios'; import { Repo } from '@/types/repo'; import { BadgeCheckIcon, LoaderCircleIcon, StarIcon } from 'lucide-react'; import { CardRow } from '@/components/ui/card'; import React, { Fragment } from 'react'; import Install from '@/pages/plugins/components/install'; import { Button } from '@/components/ui/button'; import { Separator } from '@/components/ui/separator'; export default function OfficialPlugins() { const query = useInfiniteQuery<{ total_count: number; incomplete_results: boolean; items: Repo[]; next_page?: number; }>({ queryKey: ['official-plugins'], queryFn: async ({ pageParam }) => { const data = ( await axios.get('https://api.github.com/search/repositories?q=owner:vitodeploy%20topic:vitodeploy-plugin&per_page=10&page=' + pageParam) ).data; if (data.items.length == 10) { data.next_page = (pageParam as number) + 1; } return data; }, retry: false, initialPageParam: 1, getNextPageParam: (lastPage) => lastPage.next_page, }); return (