refactor: remove unnecessary console log from ContattiProprietarioModal
This commit is contained in:
parent
511423a6b6
commit
66a70b92cc
2 changed files with 14 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { CircleCheck, ExternalLink, Trash2 } from "lucide-react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { getStorageUrl } from "~/lib/storage_utils";
|
||||
import { useSession } from "~/providers/SessionProvider";
|
||||
|
|
@ -132,6 +133,7 @@ export const DocumentiUploadSection = ({
|
|||
isPending: boolean;
|
||||
caricatoNote?: boolean;
|
||||
}) => {
|
||||
const [imageError, setImageError] = useState(false);
|
||||
if (document?.storageId) {
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
|
|
@ -145,16 +147,27 @@ export const DocumentiUploadSection = ({
|
|||
<div className="flex items-center gap-4">
|
||||
{isPending ? (
|
||||
<LoadingSpinner className="size-24 stroke-neutral-300" />
|
||||
) : (
|
||||
) : !imageError ? (
|
||||
<Image
|
||||
alt={title}
|
||||
className="size-24 rounded-md border object-cover"
|
||||
height={96}
|
||||
onError={() => setImageError(true)}
|
||||
src={getStorageUrl({
|
||||
storageId: document.storageId,
|
||||
})}
|
||||
width={96}
|
||||
/>
|
||||
) : (
|
||||
<div className="flex size-24 items-center justify-center overflow-clip rounded-md border bg-muted">
|
||||
<iframe
|
||||
className="size-full"
|
||||
src={getStorageUrl({ storageId: document.storageId })}
|
||||
title="doc"
|
||||
>
|
||||
<p>Il tuo browser non supporta gli iframe.</p>
|
||||
</iframe>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex flex-col justify-center gap-2">
|
||||
<Link
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ export const ContattiProprietarioModal = () => {
|
|||
!servizio.skipControlloDoc &&
|
||||
(!servizio.doc_personale_fronte || !servizio.doc_personale_retro);
|
||||
|
||||
console.log("needsDocuments", needsDocuments, servizio);
|
||||
|
||||
return (
|
||||
<Credenza
|
||||
onOpenChange={(o) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue