import { useZocksStore } from '../../app'
import { selectParticipantTranscripts, selectTranscriptionStatus } from './transcriptSlice'

export const useParticipantTranscript = (participantId: string, since: number = 0) => {
  const transcriptionStatus = useZocksStore(selectTranscriptionStatus)

  const { partialTranscript, finalTranscripts } = useZocksStore((state) =>
    selectParticipantTranscripts(state, participantId, since)
  )

  return { transcriptionStatus, partialTranscript, finalTranscripts }
}
