mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-10 03:11:46 +00:00
refactor(lista): componentizar inbox e tabela de lançamentos
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import { RiDeleteBin5Line, RiFileCopyLine } from "@remixicon/react";
|
||||
import MoneyValues from "@/shared/components/money-values";
|
||||
import { Button } from "@/shared/components/ui/button";
|
||||
|
||||
type TransactionsBulkBarProps = {
|
||||
selectedCount: number;
|
||||
selectedTotal: number;
|
||||
mode: "delete" | "import";
|
||||
onAction: () => void;
|
||||
};
|
||||
|
||||
export function TransactionsBulkBar({
|
||||
selectedCount,
|
||||
selectedTotal,
|
||||
mode,
|
||||
onAction,
|
||||
}: TransactionsBulkBarProps) {
|
||||
return (
|
||||
<div className="flex flex-wrap items-center gap-3 rounded-lg border bg-muted/50 px-4 py-2">
|
||||
<div className="flex flex-col text-sm text-muted-foreground sm:flex-row sm:items-center sm:gap-2">
|
||||
<span>
|
||||
{selectedCount}{" "}
|
||||
{selectedCount === 1 ? "item selecionado" : "itens selecionados"}
|
||||
</span>
|
||||
<span className="hidden sm:inline" aria-hidden>
|
||||
-
|
||||
</span>
|
||||
<span>
|
||||
Total:{" "}
|
||||
<MoneyValues
|
||||
amount={selectedTotal}
|
||||
className="inline font-medium text-foreground"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
{mode === "delete" ? (
|
||||
<Button
|
||||
onClick={onAction}
|
||||
variant="destructive"
|
||||
size="sm"
|
||||
className="ml-auto"
|
||||
>
|
||||
<RiDeleteBin5Line className="size-4" />
|
||||
Remover selecionados
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
onClick={onAction}
|
||||
variant="default"
|
||||
size="sm"
|
||||
className="ml-auto"
|
||||
>
|
||||
<RiFileCopyLine className="size-4" />
|
||||
Importar selecionados
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user