diff --git a/apps/dashboard/src/app/team/[team_slug]/(team)/~/usage/UsagePage.tsx b/apps/dashboard/src/app/team/[team_slug]/(team)/~/usage/UsagePage.tsx new file mode 100644 index 00000000000..5f5d6982965 --- /dev/null +++ b/apps/dashboard/src/app/team/[team_slug]/(team)/~/usage/UsagePage.tsx @@ -0,0 +1,40 @@ +"use client"; + +import { Spinner } from "@/components/ui/Spinner/Spinner"; +import { useAccount, useAccountUsage } from "@3rdweb-sdk/react/hooks/useApi"; +import { Flex, HStack } from "@chakra-ui/react"; +import { BillingPeriod } from "components/settings/Account/Billing/Period"; +import { BillingPlan } from "components/settings/Account/Billing/Plan"; +import { Usage } from "components/settings/Account/Usage"; + +export const SettingsUsagePage = () => { + const meQuery = useAccount(); + const usageQuery = useAccountUsage(); + const account = meQuery.data; + + if (meQuery.isLoading || !account) { + return ( +
+ +
+ ); + } + + return ( + + +

Usage

+ + + + +
+ + +
+ ); +}; diff --git a/apps/dashboard/src/app/team/[team_slug]/(team)/~/usage/page.tsx b/apps/dashboard/src/app/team/[team_slug]/(team)/~/usage/page.tsx index 51af2b73e36..b28b26e1b79 100644 --- a/apps/dashboard/src/app/team/[team_slug]/(team)/~/usage/page.tsx +++ b/apps/dashboard/src/app/team/[team_slug]/(team)/~/usage/page.tsx @@ -1,7 +1,12 @@ +import { ChakraProviderSetup } from "@/components/ChakraProviderSetup"; +import { SettingsUsagePage } from "./UsagePage"; + export default function Page() { return ( -
-

Usage

-
+ +
+ +
+
); } diff --git a/apps/dashboard/src/pages/dashboard/settings/usage.tsx b/apps/dashboard/src/pages/dashboard/settings/usage.tsx index c8623395fd9..2afe1952d90 100644 --- a/apps/dashboard/src/pages/dashboard/settings/usage.tsx +++ b/apps/dashboard/src/pages/dashboard/settings/usage.tsx @@ -1,53 +1,20 @@ -import { useAccount, useAccountUsage } from "@3rdweb-sdk/react/hooks/useApi"; -import { Flex, HStack } from "@chakra-ui/react"; import { AppLayout } from "components/app-layouts/app"; -import { BillingPeriod } from "components/settings/Account/Billing/Period"; -import { BillingPlan } from "components/settings/Account/Billing/Plan"; -import { Usage } from "components/settings/Account/Usage"; import { SettingsSidebar } from "core-ui/sidebar/settings"; import { PageId } from "page-id"; -import { Heading } from "tw-components"; import type { ThirdwebNextPage } from "utils/types"; +import { SettingsUsagePage } from "../../../app/team/[team_slug]/(team)/~/usage/UsagePage"; -const SettingsUsagePage: ThirdwebNextPage = () => { - const meQuery = useAccount(); - const usageQuery = useAccountUsage(); - - if (meQuery.isLoading || !meQuery.data) { - return null; - } - - const account = meQuery.data; - - return ( - - - - Usage - - - - - - - - - - ); +const Page: ThirdwebNextPage = () => { + return ; }; -SettingsUsagePage.getLayout = (page, props) => ( +Page.getLayout = (page, props) => ( - {page} ); -SettingsUsagePage.pageId = PageId.SettingsUsage; +Page.pageId = PageId.SettingsUsage; -export default SettingsUsagePage; +export default Page;