g1t/apps/web/app/components/account-settings.tsx
| 1 | import { Form } from "react-router"; |
| 2 | |
| 3 | import { SubmitButton } from "./ui"; |
| 4 | |
| 5 | /** |
| 6 | * One row's way out of a list in your settings: a key, a token, an |
| 7 | * application. It says it is working until the row has gone. |
| 8 | */ |
| 9 | export function DeleteButton({ |
| 10 | intent, |
| 11 | id, |
| 12 | label = "Delete", |
| 13 | pending = "Deleting…", |
| 14 | }: { |
| 15 | intent: string; |
| 16 | id: string; |
| 17 | label?: string; |
| 18 | /** The words while it works. */ |
| 19 | pending?: string; |
| 20 | }) { |
| 21 | return ( |
| 22 | <Form method="post" className="ml-auto"> |
| 23 | <input type="hidden" name="intent" value={intent} /> |
| 24 | <input type="hidden" name="id" value={id} /> |
| 25 | <SubmitButton variant="quiet" pending={pending} match={{ intent, id }}> |
| 26 | {label} |
| 27 | </SubmitButton> |
| 28 | </Form> |
| 29 | ); |
| 30 | } |