import { useContext } from "react"; import { TransportContext } from "./TransportProvider"; export function useTransport() { const context = useContext(TransportContext); if(!context){ throw new Error("useTransport must be used within a TransportProvider"); } const { uploadFile, downloadFile } = context; return { downloadFile, uploadFile }; }