diff --git a/apps/www/src/app/(dashboard)/dashboard/layout.tsx b/apps/www/src/app/(dashboard)/dashboard/layout.tsx index 3d718f06..5a7c6d5a 100644 --- a/apps/www/src/app/(dashboard)/dashboard/layout.tsx +++ b/apps/www/src/app/(dashboard)/dashboard/layout.tsx @@ -27,7 +27,7 @@ export default async function DashboardLayout({ ...dashboardConfig.sidebarNav, ...userBankAccounts.map((account) => ({ title: account.name, - href: `/dashboard/accounts/${account.id}`, // Use ID to create the URL + href: `/dashboard/banking/${account.id}`, // Use ID to create the URL })), ]; diff --git a/apps/www/src/app/(dashboard)/dashboard/page.tsx b/apps/www/src/app/(dashboard)/dashboard/page.tsx index 5ad869ec..754b8ec5 100644 --- a/apps/www/src/app/(dashboard)/dashboard/page.tsx +++ b/apps/www/src/app/(dashboard)/dashboard/page.tsx @@ -14,6 +14,8 @@ import { AddAssetFlow } from "@/components/modals/add-asset-flow"; import { EmptyPlaceholder } from "@/components/shared/empty-placeholder"; import TransactionsToReview from "@/components/tables/TransactionsToReview"; +import { AssetVsDebt } from "../../../components/charts/AssetVsDebt"; + export const metadata = { title: "Dashboard", description: @@ -32,7 +34,7 @@ export default async function DashboardPage() { return ( - +
{transactions.length === 0 ? ( @@ -40,22 +42,20 @@ export default async function DashboardPage() { - You have no transactions + You have no accounts - Let's start with importing some transactions + Let's start with adding some accounts - - - + ) : ( // Render TransactionsTable if there are transactions -
- +
-
- + + +
diff --git a/apps/www/src/components/buttons/AddAccountSheeet.tsx b/apps/www/src/components/buttons/AddAccountSheeet.tsx index b44a4cec..79bb71b9 100644 --- a/apps/www/src/components/buttons/AddAccountSheeet.tsx +++ b/apps/www/src/components/buttons/AddAccountSheeet.tsx @@ -1,6 +1,7 @@ "use client"; import { useState } from "react"; +import { useRouter } from "next/navigation"; import { createNewAccount } from "@/actions/create-new-account"; import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; @@ -51,6 +52,7 @@ const createAccountSchema = z.object({ type CreateAccount = z.infer; export function AddAccountSheet({ currentPath }) { + const router = useRouter(); const [isLoading, setIsLoading] = useState(false); const [isOpen, setIsOpen] = useState(false); @@ -75,6 +77,7 @@ export function AddAccountSheet({ currentPath }) { toast.success(`Account "${data.name}" is added.`); form.reset(); setIsOpen(false); // Close the sheet on success + router.push(`/dashboard/banking/${result.account?.id}`); } catch (error) { toast.error(error.message); console.error(error); diff --git a/apps/www/src/components/charts/AssetVsDebt.tsx b/apps/www/src/components/charts/AssetVsDebt.tsx new file mode 100644 index 00000000..468747a5 --- /dev/null +++ b/apps/www/src/components/charts/AssetVsDebt.tsx @@ -0,0 +1,115 @@ +"use client"; + +import Link from "next/link"; +import { ArrowUpRight, TrendingUp } from "lucide-react"; +import { CartesianGrid, Line, LineChart, XAxis } from "recharts"; + +import { Button } from "@dingify/ui/components/button"; +import { + Card, + CardContent, + CardDescription, + CardFooter, + CardHeader, + CardTitle, +} from "@dingify/ui/components/card"; +import { + ChartConfig, + ChartContainer, + ChartTooltip, + ChartTooltipContent, +} from "@dingify/ui/components/chart"; + +const chartData = [ + { month: "January", asset: 186, debt: 80 }, + { month: "February", asset: 305, debt: 200 }, + { month: "March", asset: 237, debt: 120 }, + { month: "April", asset: 73, debt: 190 }, + { month: "May", asset: 209, debt: 130 }, + { month: "June", asset: 214, debt: 140 }, +]; + +const chartConfig = { + asset: { + label: "Asset", + color: "hsl(var(--chart-1))", + }, + debt: { + label: "Debt", + color: "hsl(var(--chart-2))", + }, +} satisfies ChartConfig; + +export function AssetVsDebt() { + return ( + + +
+ Asset vs Debt + Do you have more Asset vs debt? +
+ +
+ + + + + value.slice(0, 3)} + /> + } /> + + + + + + +
+
+
+ Trending up by 5.2% this month +
+
+ Your getting more assets vs debt +
+
+
+
+
+ ); +} diff --git a/apps/www/src/config/dashboard.ts b/apps/www/src/config/dashboard.ts index 32cc394a..fb366c8e 100644 --- a/apps/www/src/config/dashboard.ts +++ b/apps/www/src/config/dashboard.ts @@ -27,26 +27,31 @@ export const dashboardConfig: DashboardConfig = { href: "/dashboard/categories", title: "Categories", icon: "piechart", + disabled: true, }, { href: "/investment", title: "Investments", icon: "BarChart", + disabled: true, }, { href: "/assets", title: "Assets", icon: "Building", + disabled: true, }, { href: "/savings", title: "Savings", icon: "Sprout", + disabled: true, }, { href: "/liabilities", title: "Liabilities", icon: "CreditCard", + disabled: true, }, ], };