39 lines
1008 B
TypeScript
39 lines
1008 B
TypeScript
"use client";
|
|
|
|
import { useTransition } from "react";
|
|
import { removeLightboxItemAction } from "./actions";
|
|
|
|
export function RemoveLightboxItemButton({ assetId }: { assetId: string }) {
|
|
const [isPending, startTransition] = useTransition();
|
|
|
|
function handleRemove() {
|
|
startTransition(async () => {
|
|
await removeLightboxItemAction(assetId);
|
|
});
|
|
}
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={handleRemove}
|
|
disabled={isPending}
|
|
className="p-1.5 bg-white rounded-full shadow hover:bg-gray-100 text-gray-500 hover:text-red-500 transition-colors"
|
|
title="Aus Merkzettel entfernen"
|
|
aria-label="Aus Merkzettel entfernen"
|
|
>
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
strokeWidth="2"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
className="w-4 h-4"
|
|
>
|
|
<path d="M18 6L6 18M6 6l12 12" />
|
|
</svg>
|
|
</button>
|
|
);
|
|
}
|