diff --git a/src/app/(dashboard)/layout.tsx b/src/app/(dashboard)/layout.tsx index af2e1fd..d7f0cfd 100644 --- a/src/app/(dashboard)/layout.tsx +++ b/src/app/(dashboard)/layout.tsx @@ -2,6 +2,7 @@ import { fetchDashboardNotifications } from "@/features/dashboard/notifications- import { fetchPendingInboxCount } from "@/features/inbox/queries"; import { AppNavbar } from "@/shared/components/navigation/navbar/app-navbar"; import { PrivacyProvider } from "@/shared/components/providers/privacy-provider"; +import { DotPattern } from "@/shared/components/ui/dot-pattern"; import { getUserSession } from "@/shared/lib/auth/server"; import { fetchPayersWithAccess } from "@/shared/lib/payers/access"; import { PAYER_ROLE_ADMIN } from "@/shared/lib/payers/constants"; @@ -48,7 +49,17 @@ export default async function DashboardLayout({ notificationsSnapshot={notificationsSnapshot} />
-
+
+ +
+
{children} diff --git a/src/features/dashboard/components/category-history-widget.tsx b/src/features/dashboard/components/category-history-widget.tsx index 0bef612..7e7edc1 100644 --- a/src/features/dashboard/components/category-history-widget.tsx +++ b/src/features/dashboard/components/category-history-widget.tsx @@ -174,12 +174,11 @@ export function CategoryHistoryWidget({ data }: CategoryHistoryWidgetProps) { {selectedCategoryDetails.length > 0 && (
- {selectedCategoryDetails.map((category) => { + {selectedCategoryDetails.map((category, colorIndex) => { if (!category) return null; const IconComponent = category.icon ? getIconComponent(category.icon) : null; - const colorIndex = selectedCategories.indexOf(category.id); const color = CHART_COLORS[colorIndex % CHART_COLORS.length]; return ( diff --git a/src/features/dashboard/components/dashboard-metrics-cards.tsx b/src/features/dashboard/components/dashboard-metrics-cards.tsx index f26c490..ecff3e6 100644 --- a/src/features/dashboard/components/dashboard-metrics-cards.tsx +++ b/src/features/dashboard/components/dashboard-metrics-cards.tsx @@ -11,11 +11,14 @@ import type { DashboardCardMetrics } from "@/features/dashboard/dashboard-metric import MoneyValues from "@/shared/components/money-values"; import { Card, - CardFooter, + CardContent, + CardDescription, CardHeader, CardTitle, } from "@/shared/components/ui/card"; +import { Separator } from "@/shared/components/ui/separator"; import { formatPercentage } from "@/shared/utils/percentage"; +import { cn } from "@/shared/utils/ui"; type DashboardMetricsCardsProps = { metrics: DashboardCardMetrics; @@ -28,35 +31,35 @@ const TREND_THRESHOLD = 0.005; const CARDS = [ { label: "Receitas", + subtitle: "Entradas do período", key: "receitas", icon: RiArrowUpLine, invertTrend: false, - cardClass: "", iconClass: "text-success", }, { label: "Despesas", + subtitle: "Saídas do período", key: "despesas", icon: RiArrowDownLine, invertTrend: true, - cardClass: "", iconClass: "text-destructive", }, { label: "Balanço", + subtitle: "Receitas menos despesas", key: "balanco", icon: RiScalesLine, invertTrend: false, - cardClass: "", - iconClass: "text-amber-500", + iconClass: "text-warning", }, { label: "Previsto", + subtitle: "Saldo acumulado projetado", key: "previsto", icon: RiCalendarCheckLine, invertTrend: false, - cardClass: "border border-dashed", - iconClass: "", + iconClass: "text-primary", }, ] as const; @@ -91,8 +94,8 @@ const getPercentChange = (current: number, previous: number): string => { : "—"; }; -const getTrendColor = (trend: Trend, invertTrend: boolean): string => { - if (trend === "flat") return "text-muted-foreground"; +const getTrendBadgeClass = (trend: Trend, invertTrend: boolean): string => { + if (trend === "flat") return "bg-muted text-muted-foreground"; const isPositive = invertTrend ? trend === "down" : trend === "up"; return isPositive ? "text-success" : "text-destructive"; }; @@ -101,36 +104,61 @@ export function DashboardMetricsCards({ metrics }: DashboardMetricsCardsProps) { return (
{CARDS.map( - ({ label, key, icon: Icon, invertTrend, cardClass, iconClass }) => { + ({ label, subtitle, key, icon: Icon, invertTrend, iconClass }) => { const metric = metrics[key]; const trend = getTrend(metric.current, metric.previous); const TrendIcon = TREND_ICONS[trend]; - const trendColor = getTrendColor(trend, invertTrend); + const trendBadgeClass = getTrendBadgeClass(trend, invertTrend); + const percentChange = getPercentChange( + metric.current, + metric.previous, + ); return ( - + - - - {label} - -
- -
- - {getPercentChange(metric.current, metric.previous)} +
+
+ + + {label} + + + {subtitle} +
+ - -
- vs. mês anterior - + + +
+ +
+ + {percentChange} +
- + +
+ + no mês anterior +
+
); }, diff --git a/src/features/dashboard/components/dashboard-welcome.tsx b/src/features/dashboard/components/dashboard-welcome.tsx index c26da28..78f756e 100644 --- a/src/features/dashboard/components/dashboard-welcome.tsx +++ b/src/features/dashboard/components/dashboard-welcome.tsx @@ -6,12 +6,12 @@ export function DashboardWelcome({ name }: { name?: string | null }) { const greeting = getGreeting(); return ( -
+

- {greeting}, {displayName} + {greeting}, {displayName}

-

{formattedDate}

+

{formattedDate}

); diff --git a/src/features/dashboard/components/notes/note-list-item.tsx b/src/features/dashboard/components/notes/note-list-item.tsx index af9e6a7..8ec43cf 100644 --- a/src/features/dashboard/components/notes/note-list-item.tsx +++ b/src/features/dashboard/components/notes/note-list-item.tsx @@ -40,20 +40,20 @@ export function NoteListItem({
-
+