quota context hook
This commit is contained in:
@@ -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({});
|
||||
|
||||
Reference in New Issue
Block a user