feat(catalog): persist idempotent bulk operations and retryable deliveries
This commit is contained in:
1 parent
76e46d295c
commit
13665e0c3c
53 files changed
+1316
-76
No files matched your search
@@ -0,0 +1,23 @@
|
||||
"use client";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useServerAction } from "@/hooks/use-server-action";
|
||||
import { retryDelivery } from "./retry-action";
|
||||
export function DeliveryRetry({ id }: { id: string }) {
|
||||
const t = useTranslations("pages.admin.deliveries");
|
||||
const { run, isPending } = useServerAction();
|
||||
return (
|
||||
<Button
|
||||
variant="outline"
|
||||
disabled={isPending}
|
||||
onClick={() =>
|
||||
run(() => retryDelivery(id), {
|
||||
successMessage: t("retried"),
|
||||
errorMessage: t("retryError"),
|
||||
})
|
||||
}
|
||||
>
|
||||
{t("retry")}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user