diff --git a/resources/scripts/components/server/modrinth/DisplayMods.tsx b/resources/scripts/components/server/modrinth/DisplayMods.tsx index 7ac6292ac..1e4b32f19 100644 --- a/resources/scripts/components/server/modrinth/DisplayMods.tsx +++ b/resources/scripts/components/server/modrinth/DisplayMods.tsx @@ -4,6 +4,8 @@ import { toast } from 'sonner'; import ContentBox from '@/components/elements/ContentBox'; import HugeIconsDownload from '@/components/elements/hugeicons/Download'; +import { ServerContext } from '@/state/server'; + // import { useProjects } from './FetchProjects'; import { apiEndpoints, offset, settings } from './config'; @@ -32,6 +34,8 @@ const ProjectSelector: React.FC = ({ appVersion, baseUrl, nonApiUrl }) => const [projects, setProjects] = useState([]); const [isLoading, setIsLoading] = useState(false); + const uuid = ServerContext.useStoreState((state) => state.server.data!); + const fetchProjects = async () => { setIsLoading(true); // Start loading try { @@ -74,6 +78,8 @@ const ProjectSelector: React.FC = ({ appVersion, baseUrl, nonApiUrl }) => icon_url: project.icon_url || 'N/A', })); + // console.log(uuid); + setProjects(updatedProjects); } catch (error) { toast.error('Failed to fetch projects.'); @@ -99,11 +105,6 @@ const ProjectSelector: React.FC = ({ appVersion, baseUrl, nonApiUrl }) => } }; - const getData = (): null => { - console.log(settings); - return null; - }; - return (