refactor: update icons and improve layout structure across components

This commit is contained in:
Felipe Coutinho
2025-11-17 11:29:06 -03:00
parent cdf79600e9
commit 3ca495384c
12 changed files with 107 additions and 110 deletions

View File

@@ -18,8 +18,7 @@ export type AccountData = {
};
export async function fetchAccountsForUser(
userId: string,
currentPeriod: string
userId: string
): Promise<{ accounts: AccountData[]; logoOptions: LogoOption[] }> {
const [accountRows, logoOptions] = await Promise.all([
db
@@ -50,14 +49,10 @@ export async function fetchAccountsForUser(
and(
eq(lancamentos.contaId, contas.id),
eq(lancamentos.userId, userId),
eq(lancamentos.period, currentPeriod),
eq(lancamentos.isSettled, true)
)
)
.leftJoin(
pagadores,
eq(lancamentos.pagadorId, pagadores.id)
)
.leftJoin(pagadores, eq(lancamentos.pagadorId, pagadores.id))
.where(
and(
eq(contas.userId, userId),

View File

@@ -5,14 +5,8 @@ import { fetchAccountsForUser } from "./data";
export default async function Page() {
const userId = await getUserId();
const now = new Date();
const currentPeriod = `${now.getFullYear()}-${String(
now.getMonth() + 1
).padStart(2, "0")}`;
const { accounts, logoOptions } = await fetchAccountsForUser(
userId,
currentPeriod
);
const { accounts, logoOptions } = await fetchAccountsForUser(userId);
return (
<main className="flex flex-col items-start gap-6">