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

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

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

  return { displayTranscriptions, partialTranscript, finalTranscripts }
}
