import React from 'react';
import { findChildElement, queryAncestors } from '../../dom-utils';
import { useExamTranslation } from '../../i18n';
export const Recording = ({ element, renderChildNodes }) => {
    const transcription = findChildElement(element, ['audio-transcription', 'video-transcription']);
    if (transcription) {
        const { t } = useExamTranslation();
        const title = findChildElement(element, ['audio-title', 'video-title']);
        return (React.createElement("details", { className: "e-grading-instruction-recording e-pad-1 e-mrg-b-2" },
            React.createElement("summary", null,
                React.createElement("strong", null, t('recording')),
                " ",
                title && React.createElement("em", null, renderChildNodes(title))),
            renderChildNodes(transcription)));
    }
    const isInDndAnswer = queryAncestors(element, 'dnd-answer');
    return isInDndAnswer ? '[Audio]' : null;
};
export default Recording;
//# sourceMappingURL=Recording.js.map