Skip to content

Commit

Permalink
Confirm delete account
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Dec 9, 2024
1 parent e8e76a3 commit a071904
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion apps/dashboard/src/components/bank-account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
DropdownMenuTrigger,
} from "@midday/ui/dropdown-menu";
import { Icons } from "@midday/ui/icons";
import { Input } from "@midday/ui/input";
import { Label } from "@midday/ui/label";
import { Switch } from "@midday/ui/switch";
import {
Tooltip,
Expand Down Expand Up @@ -61,6 +63,7 @@ export function BankAccount({
type,
hasError,
}: Props) {
const [value, setValue] = useState("");
const [_, setParams] = useQueryStates({
step: parseAsString,
accountId: parseAsString,
Expand Down Expand Up @@ -168,10 +171,22 @@ export function BankAccount({
transactions associated with this account will also be deleted.
</AlertDialogDescription>
</AlertDialogHeader>

<div className="flex flex-col gap-2 mt-2">
<Label htmlFor="confirm-delete">
Type <span className="font-medium">DELETE</span> to confirm.
</Label>
<Input
id="confirm-delete"
value={value}
onChange={(e) => setValue(e.target.value)}
/>
</div>

<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
disabled={deleteAccount.status === "executing"}
disabled={value !== "DELETE"}
onClick={() =>
deleteAccount.execute({
id,
Expand Down

0 comments on commit a071904

Please sign in to comment.