Skip to content

Commit

Permalink
feat: ✨ add button to delete transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
neopromic committed Nov 26, 2024
1 parent 5fa50f8 commit 9e8ecd9
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { deleteTransaction } from "@/app/_actions/delete-transactions";
import { Button } from "@/app/_components/ui/button";
import { TrashIcon } from "lucide-react";

interface IDeleteTransactionsButtonProps {
transactionId: string;
}

const DeleteTransactionButton = ({
transactionId,
}: IDeleteTransactionsButtonProps) => {
const handleClick = async () => {
await deleteTransaction({ transactionId });
};

return (
<Button variant="ghost" size="icon" onClick={handleClick}>
<TrashIcon size={16} />
</Button>
);
};

export default DeleteTransactionButton;

0 comments on commit 9e8ecd9

Please sign in to comment.