diff --git a/apps/infoalloggi/src/components/servizio/annuncio_actions.tsx b/apps/infoalloggi/src/components/servizio/annuncio_actions.tsx
index ac3804d..b947e73 100644
--- a/apps/infoalloggi/src/components/servizio/annuncio_actions.tsx
+++ b/apps/infoalloggi/src/components/servizio/annuncio_actions.tsx
@@ -1,17 +1,27 @@
import {
- ExternalLink,
- Eye,
FileBadge,
FileText,
FolderKanban,
+ Info,
Mail,
PackageCheck,
Pointer,
Printer,
Trash2,
+ Wrench,
} from "lucide-react";
import Link from "next/link";
import toast from "react-hot-toast";
+import {
+ AlertDialog,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+ AlertDialogTrigger,
+} from "~/components/ui/alert-dialog";
import { Button, type ButtonConfigs } from "~/components/ui/button";
import {
Tooltip,
@@ -49,75 +59,79 @@ export const AdminActions = () => {
if (!isAdmin) return null;
return (
-
- {
}
- {data.user_confirmed_at != null &&
}
- {data.accettato_conferma_at != null && (
- <>
-
- {data.gestionale_id && (
-
-
-
- )}
- >
- )}
-
+ <>
+
Azioni Admin:
+
+
+
+ {data.user_confirmed_at != null &&
}
+ {data.accettato_conferma_at != null && (
+ <>
+
+ {data.gestionale_id && (
+
+
+
+ )}
+ >
+ )}
+ {/*
-
-
-
-
+
+
-
-
-
-
-
{
- mutate({
- annuncioId,
- servizioId,
- });
- }}
- title="Elimina annuncio"
- >
-
-
-
+
+
+
+
{
+ mutate({
+ annuncioId,
+ servizioId,
+ });
+ }}
+ title="Elimina annuncio"
+ >
+
+
+
+ >
);
};
@@ -156,7 +170,7 @@ const AdminSendScheda = () => {
>
);
@@ -243,6 +257,61 @@ export const UserActions = () => {
>
);
};
+const AdminAnnuncioContatti = () => {
+ const { data } = useServizioAnnuncio();
+ const { data: annuncio, isLoading } = api.annunci.getAnnuncioFull.useQuery({
+ id: data.id,
+ });
+ return (
+
+
+
+
+
+
+ Contatti Annuncio {data.codice}
+
+ desc
+
+
+
+
+ Contatti Aperti il:
+ {data.open_contatti_at
+ ? new Date(data.open_contatti_at).toLocaleString("it-IT")
+ : "Non ancora aperti"}
+
+ {isLoading ? (
+
+ Loading...
+
+ ) : (
+ <>
+
+ Locatore/Incaricato:
+ {annuncio?.locatore || "N/A"}
+
+
+ Email:
+ {annuncio?.email || "N/A"}
+
+
+ Telefono:
+ {annuncio?.numero || "N/A"}
+
+ >
+ )}
+
+
+ Chiudi
+
+
+
+ );
+};
const PostConfermaSection = () => {
const { servizio, servizioId } = useServizio();
diff --git a/apps/infoalloggi/src/components/servizio/annuncio_card.tsx b/apps/infoalloggi/src/components/servizio/annuncio_card.tsx
index 1d5b4ca..c7781c7 100644
--- a/apps/infoalloggi/src/components/servizio/annuncio_card.tsx
+++ b/apps/infoalloggi/src/components/servizio/annuncio_card.tsx
@@ -1,19 +1,9 @@
-import { Info, Toolbox } from "lucide-react";
+import { Toolbox } from "lucide-react";
import Image from "next/image";
import {
AdminActions,
UserActions,
} from "~/components/servizio/annuncio_actions";
-import {
- AlertDialog,
- AlertDialogCancel,
- AlertDialogContent,
- AlertDialogDescription,
- AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
- AlertDialogTrigger,
-} from "~/components/ui/alert-dialog";
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
import { handleConsegna } from "~/lib/annuncio_details";
import { getStorageUrl } from "~/lib/storage_utils";
@@ -21,7 +11,6 @@ import { cn, formatCurrency } from "~/lib/utils";
import { useTranslation } from "~/providers/I18nProvider";
import { useServizio, useServizioAnnuncio } from "~/providers/ServizioProvider";
import type { AnnuncioRicerca } from "~/server/controllers/annunci.controller";
-import { api } from "~/utils/api";
import { Button } from "../ui/button";
import {
Collapsible,
@@ -49,7 +38,7 @@ export const AnnuncioCard = ({ className }: { className?: string }) => {
-
-
);
};
-
-const AdminAnnuncioContatti = () => {
- const { data } = useServizioAnnuncio();
- const { data: annuncio, isLoading } = api.annunci.getAnnuncioFull.useQuery({
- id: data.id,
- });
- return (
-
-
-
-
- Dati Contatto
-
-
-
-
- Contatti Annuncio {data.codice}
-
- desc
-
-
-
-
- Contatti Aperti il:
- {data.open_contatti_at
- ? new Date(data.open_contatti_at).toLocaleString("it-IT")
- : "Non ancora aperti"}
-
- {isLoading ? (
-
- Loading...
-
- ) : (
- <>
-
- Locatore/Incaricato:
- {annuncio?.locatore || "N/A"}
-
-
- Email:
- {annuncio?.email || "N/A"}
-
-
- Telefono:
- {annuncio?.numero || "N/A"}
-
- >
- )}
-
-
- Chiudi
-
-
-
- );
-};
diff --git a/apps/infoalloggi/src/components/tables/users-table.tsx b/apps/infoalloggi/src/components/tables/users-table.tsx
index c80334e..3b07c32 100644
--- a/apps/infoalloggi/src/components/tables/users-table.tsx
+++ b/apps/infoalloggi/src/components/tables/users-table.tsx
@@ -135,7 +135,7 @@ export const UsersTable = (props: { data: UserWChatInfo[] }) => {