- Replace ESLint with Biome for linting and formatting - Configure Biome with tabs, double quotes, and organized imports - Move all SQL/Drizzle queries from page.tsx files to data.ts files - Create new data.ts files for: ajustes, dashboard, relatorios/categorias - Update existing data.ts files: extrato, fatura (add lancamentos queries) - Remove all drizzle-orm imports from page.tsx files - Update README.md with new tooling info Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { MonthlyCalendar } from "@/components/calendario/monthly-calendar";
|
|
import type { CalendarPeriod } from "@/components/calendario/types";
|
|
import MonthNavigation from "@/components/month-picker/month-navigation";
|
|
import { getUserId } from "@/lib/auth/server";
|
|
import {
|
|
getSingleParam,
|
|
type ResolvedSearchParams,
|
|
} from "@/lib/lancamentos/page-helpers";
|
|
import { parsePeriodParam } from "@/lib/utils/period";
|
|
import { fetchCalendarData } from "./data";
|
|
|
|
type PageSearchParams = Promise<ResolvedSearchParams>;
|
|
|
|
type PageProps = {
|
|
searchParams?: PageSearchParams;
|
|
};
|
|
|
|
export default async function Page({ searchParams }: PageProps) {
|
|
const userId = await getUserId();
|
|
const resolvedParams = searchParams ? await searchParams : undefined;
|
|
|
|
const periodoParam = getSingleParam(resolvedParams, "periodo");
|
|
const { period, monthName, year } = parsePeriodParam(periodoParam);
|
|
|
|
const calendarData = await fetchCalendarData({
|
|
userId,
|
|
period,
|
|
});
|
|
|
|
const calendarPeriod: CalendarPeriod = {
|
|
period,
|
|
monthName,
|
|
year,
|
|
};
|
|
|
|
return (
|
|
<main className="flex flex-col gap-3">
|
|
<MonthNavigation />
|
|
<MonthlyCalendar
|
|
period={calendarPeriod}
|
|
events={calendarData.events}
|
|
formOptions={calendarData.formOptions}
|
|
/>
|
|
</main>
|
|
);
|
|
}
|