// Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React from 'react'; import { Heading, Grid, Cell } from 'amazon-chime-sdk-component-library-react'; import { useTheme } from 'styled-components'; function LiveTranscription(props) { const currentTheme = useTheme(); const transcriptSegmentArray = Array.from(props.transcriptSegments.values()); transcriptSegmentArray.sort((a, b) => b.startTimeMs - a.startTimeMs); return ( Live Transcription
    {transcriptSegmentArray.map((segment, index) => { return (
  • {segment.attendee.externalUserId.split('#').slice(-1)[0] + ': '} {segment.content}
      {segment.entities.map((entity, ind) => { if (entity.category == 'ANATOMY') { return (
    • {entity.text} [score: {entity.score}]
    • ); } else if (entity.category == 'MEDICAL_CONDITION') { return (
    • {entity.text} [score: {entity.score}]
    • ); } else if (entity.category == 'MEDICATION') { return (
    • {entity.text} [score: {entity.score}]
    • ); } else if ( entity.category == 'TEST_TREATMENT_PROCEDURE' ) { return (
    • {entity.text} [score: {entity.score}]
    • ); } })}
  • ); })}
); } export default LiveTranscription;