import { createContext, useContext } from "react"; import type { Annunci } from "~/schemas/public/Annunci"; export const AnnuncioContext = createContext | null>(null); export const useAnnuncio = () => { const context = useContext(AnnuncioContext); if (!context) { throw new Error("useAnnuncio must be used within a AnnuncioProvider"); } return context; };