Last active
July 16, 2025 14:49
-
-
Save codigoconjuan/74ec192f8f2485779d39175e27c72a18 to your computer and use it in GitHub Desktop.
Modal para Eliminar Producto en Astro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dialog, DialogBackdrop, DialogPanel, DialogTitle } from '@headlessui/react' | |
import { XMarkIcon } from '@heroicons/react/24/outline' | |
export default function DeleteProductModal() { | |
return ( | |
<div> | |
<Dialog open={true} onClose={() => {} } className="relative z-10"> | |
<DialogBackdrop | |
transition | |
className="fixed inset-0 bg-gray-800/75 transition-opacity data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in" | |
/> | |
<div className="fixed inset-0 z-10 w-screen overflow-y-auto"> | |
<div className="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"> | |
<DialogPanel | |
transition | |
className="relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all data-closed:translate-y-4 data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in sm:my-8 sm:w-full sm:max-w-lg sm:p-6 data-closed:sm:translate-y-0 data-closed:sm:scale-95" | |
> | |
<div> | |
<div className="mx-auto flex size-12 items-center justify-center rounded-full bg-red-100"> | |
<XMarkIcon aria-hidden="true" className="size-8 text-red-600" /> | |
</div> | |
<div className="mt-3 text-center sm:mt-5"> | |
<DialogTitle as="h3" className="text-base font-semibold text-gray-900"> | |
¿Eliminar Producto? | |
</DialogTitle> | |
<div className="mt-2"> | |
<p className="text-sm text-gray-500"> | |
¿Confirmas que deseas eliminar este producto? Un Producto eliminado no se puede recuperar. | |
</p> | |
</div> | |
</div> | |
</div> | |
<div className="mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3"> | |
<button | |
type="button" | |
onClick={() => {}} | |
className="inline-flex w-full justify-center rounded-md bg-amber-400 px-3 py-2 text-sm font-semibold shadow-xs hover:bg-amber-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-amber-400 sm:col-start-2 text-black" | |
> | |
Eliminar | |
</button> | |
<button | |
type="button" | |
data-autofocus | |
onClick={() => {}} | |
className="mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-xs ring-1 ring-gray-300 ring-inset hover:bg-gray-50 sm:col-start-1 sm:mt-0" | |
> | |
Cancelar | |
</button> | |
</div> | |
</DialogPanel> | |
</div> | |
</div> | |
</Dialog> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment