import { useEffect, useState } from 'react' import { Contract, listenForContract } from '../lib/firebase/contracts' export const useContract = (contractId: string) => { const [contract, setContract] = useState('loading') useEffect(() => { if (contractId) return listenForContract(contractId, setContract) }, [contractId]) return contract }