quota context hook

This commit is contained in:
2025-08-03 19:59:01 +02:00
parent 3eadd5c15d
commit 67d8dac8c0
4 changed files with 24 additions and 23 deletions
+3 -7
View File
@@ -3,18 +3,14 @@ import { useAuth } from "react-oidc-context";
import { useEffect, useState } from "react";
import { Nunito } from "next/font/google";
import { api, Profile } from "muzak/data/fetcher";
import { useQuota } from "muzak/contexts/QuotaContext";
const nunito = Nunito({
subsets: ["latin"],
});
export default function Quota({
quota,
setQuota,
}: {
quota: number | null;
setQuota: React.Dispatch<React.SetStateAction<number | null>>;
}) {
export default function Quota() {
const auth = useAuth();
const { quota, setQuota } = useQuota();
async function getProfile() {
if (!auth.isLoading && !auth.error && auth.isAuthenticated) {
const { data: profile } = await api?.profiles?.me({});