chore(cleanup): remove dead code and legacy top-estabelecimentos route
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
import { FieldDescription } from "@/components/ui/field";
|
||||
|
||||
export function AuthFooter() {
|
||||
return (
|
||||
<FieldDescription className="px-6 text-center">
|
||||
Ao continuar, você concorda com nossos{" "}
|
||||
<a href="/terms" className="underline underline-offset-4">
|
||||
Termos de Serviço
|
||||
</a>{" "}
|
||||
e{" "}
|
||||
<a href="/privacy" className="underline underline-offset-4">
|
||||
Política de Privacidade
|
||||
</a>
|
||||
.
|
||||
</FieldDescription>
|
||||
);
|
||||
}
|
||||
@@ -255,7 +255,6 @@ export function LoginForm({ className, ...props }: DivProps) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* <AuthFooter /> */}
|
||||
<FieldDescription className="text-center">
|
||||
<a href="/" className="underline underline-offset-4">
|
||||
Voltar para o site
|
||||
|
||||
@@ -281,7 +281,6 @@ export function SignupForm({ className, ...props }: DivProps) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* <AuthFooter /> */}
|
||||
<FieldDescription className="text-center">
|
||||
<a href="/" className="underline underline-offset-4">
|
||||
Voltar para o site
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
RiDeleteBin5Line,
|
||||
RiFileList2Line,
|
||||
RiPencilLine,
|
||||
} from "@remixicon/react";
|
||||
import Link from "next/link";
|
||||
import { Card, CardContent, CardFooter } from "@/components/ui/card";
|
||||
import { cn } from "@/lib/utils/ui";
|
||||
import { CategoryIconBadge } from "./category-icon-badge";
|
||||
import type { Category } from "./types";
|
||||
|
||||
interface CategoryCardProps {
|
||||
category: Category;
|
||||
colorIndex: number;
|
||||
onEdit: (category: Category) => void;
|
||||
onRemove: (category: Category) => void;
|
||||
}
|
||||
|
||||
export function CategoryCard({
|
||||
category,
|
||||
colorIndex,
|
||||
onEdit,
|
||||
onRemove,
|
||||
}: CategoryCardProps) {
|
||||
const categoriasProtegidas = [
|
||||
"Transferência interna",
|
||||
"Saldo inicial",
|
||||
"Pagamentos",
|
||||
];
|
||||
const isProtegida = categoriasProtegidas.includes(category.name);
|
||||
|
||||
const actions = [
|
||||
{
|
||||
label: "editar",
|
||||
icon: <RiPencilLine className="size-4" aria-hidden />,
|
||||
onClick: () => onEdit(category),
|
||||
variant: "default" as const,
|
||||
disabled: isProtegida,
|
||||
},
|
||||
{
|
||||
label: "detalhes",
|
||||
icon: <RiFileList2Line className="size-4" aria-hidden />,
|
||||
href: `/categorias/${category.id}`,
|
||||
variant: "default" as const,
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: "remover",
|
||||
icon: <RiDeleteBin5Line className="size-4" aria-hidden />,
|
||||
onClick: () => onRemove(category),
|
||||
variant: "destructive" as const,
|
||||
disabled: isProtegida,
|
||||
},
|
||||
].filter((action) => !action.disabled);
|
||||
|
||||
return (
|
||||
<Card className="flex h-full flex-col gap-0 py-3">
|
||||
<CardContent className="flex flex-1 flex-col">
|
||||
<div className="flex items-center gap-3">
|
||||
<CategoryIconBadge
|
||||
icon={category.icon}
|
||||
name={category.name}
|
||||
colorIndex={colorIndex}
|
||||
size="md"
|
||||
/>
|
||||
<h3 className="leading-tight">{category.name}</h3>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
<CardFooter className="flex flex-wrap gap-3 px-6 pt-4 text-sm">
|
||||
{actions.map(({ label, icon, onClick, href, variant }) => {
|
||||
const className = cn(
|
||||
"flex items-center gap-1 font-medium transition-opacity hover:opacity-80",
|
||||
variant === "destructive" ? "text-destructive" : "text-primary",
|
||||
);
|
||||
|
||||
if (href) {
|
||||
return (
|
||||
<Link key={label} href={href} className={className}>
|
||||
{icon}
|
||||
{label}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
key={label}
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
className={className}
|
||||
>
|
||||
{icon}
|
||||
{label}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</CardFooter>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
import { RiExchangeLine } from "@remixicon/react";
|
||||
import { EstabelecimentoLogo } from "@/components/lancamentos/shared/estabelecimento-logo";
|
||||
import MoneyValues from "@/components/money-values";
|
||||
import type { RecentTransactionsData } from "@/lib/dashboard/recent-transactions";
|
||||
import { WidgetEmptyState } from "../widget-empty-state";
|
||||
|
||||
type RecentTransactionsWidgetProps = {
|
||||
data: RecentTransactionsData;
|
||||
};
|
||||
|
||||
const formatTransactionDate = (date: Date | string) => {
|
||||
const d = date instanceof Date ? date : new Date(date);
|
||||
const formatter = new Intl.DateTimeFormat("pt-BR", {
|
||||
weekday: "short",
|
||||
day: "2-digit",
|
||||
month: "short",
|
||||
timeZone: "UTC",
|
||||
});
|
||||
|
||||
const formatted = formatter.format(d);
|
||||
// Capitaliza a primeira letra do dia da semana
|
||||
return formatted.charAt(0).toUpperCase() + formatted.slice(1);
|
||||
};
|
||||
|
||||
export function RecentTransactionsWidget({
|
||||
data,
|
||||
}: RecentTransactionsWidgetProps) {
|
||||
return (
|
||||
<div className="flex flex-col px-0">
|
||||
{data.transactions.length === 0 ? (
|
||||
<WidgetEmptyState
|
||||
icon={<RiExchangeLine className="size-6 text-muted-foreground" />}
|
||||
title="Nenhum lançamento encontrado"
|
||||
description="Quando houver despesas registradas, elas aparecerão aqui."
|
||||
/>
|
||||
) : (
|
||||
<ul className="flex flex-col">
|
||||
{data.transactions.map((transaction) => {
|
||||
return (
|
||||
<li
|
||||
key={transaction.id}
|
||||
className="flex items-center justify-between gap-3 border-b border-dashed py-2 last:border-b-0 last:pb-0"
|
||||
>
|
||||
<div className="flex min-w-0 flex-1 items-center gap-3">
|
||||
<EstabelecimentoLogo name={transaction.name} size={37} />
|
||||
|
||||
<div className="min-w-0">
|
||||
<p className="truncate text-sm font-medium text-foreground">
|
||||
{transaction.name}
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{formatTransactionDate(transaction.purchaseDate)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="shrink-0 text-foreground">
|
||||
<MoneyValues amount={transaction.amount} />
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// Main page component
|
||||
|
||||
export { default as AnticipateInstallmentsDialog } from "./dialogs/anticipate-installments-dialog/anticipate-installments-dialog";
|
||||
export { default as BulkActionDialog } from "./dialogs/bulk-action-dialog";
|
||||
export { default as LancamentoDetailsDialog } from "./dialogs/lancamento-details-dialog";
|
||||
|
||||
// Main dialogs
|
||||
export { default as LancamentoDialog } from "./dialogs/lancamento-dialog/lancamento-dialog";
|
||||
export type * from "./dialogs/lancamento-dialog/lancamento-dialog-types";
|
||||
export { default as MassAddDialog } from "./dialogs/mass-add-dialog";
|
||||
export { default as LancamentosPage } from "./page/lancamentos-page";
|
||||
export * from "./select-items";
|
||||
export { default as AnticipationCard } from "./shared/anticipation-card";
|
||||
// Shared components
|
||||
export { default as EstabelecimentoInput } from "./shared/estabelecimento-input";
|
||||
export { default as InstallmentTimeline } from "./shared/installment-timeline";
|
||||
export { default as LancamentosFilters } from "./table/lancamentos-filters";
|
||||
// Table components
|
||||
export { default as LancamentosTable } from "./table/lancamentos-table";
|
||||
// Types and utilities
|
||||
export type * from "./types";
|
||||
@@ -1,4 +0,0 @@
|
||||
export { AnticipationCard } from "./anticipation-card";
|
||||
export { EstabelecimentoInput } from "./estabelecimento-input";
|
||||
export { EstabelecimentoLogo } from "./estabelecimento-logo";
|
||||
export { InstallmentTimeline } from "./installment-timeline";
|
||||
@@ -1,13 +0,0 @@
|
||||
export { CategoryCell } from "./category-cell";
|
||||
export { CategoryReportCards } from "./category-report-cards";
|
||||
export { CategoryReportChart } from "./category-report-chart";
|
||||
export { CategoryReportExport } from "./category-report-export";
|
||||
export { CategoryReportFilters } from "./category-report-filters";
|
||||
export { CategoryReportPage } from "./category-report-page";
|
||||
export { CategoryReportTable } from "./category-report-table";
|
||||
export { CategoryTable } from "./category-table";
|
||||
export type {
|
||||
CategoryOption,
|
||||
CategoryReportFiltersProps,
|
||||
FilterState,
|
||||
} from "./types";
|
||||
Reference in New Issue
Block a user