<?php

/**
 * Accordion: Transcription.
 *
 * @link    https://aiopodcasting.com
 * @since   1.0.0
 *
 * @package AiO_Podcast_Studio
 */

// Exit if accessed directly
if ( ! defined( 'WPINC' ) ) {
	die;
}

$enable_transcription = isset( $post_meta['enable_transcription'] ) ? $post_meta['enable_transcription'][0] : 0;
$transcription = isset( $post_meta['transcription'] ) ? $post_meta['transcription'][0] : '';
?>
<div class="aiopod-form-controls">
    <div class="aiopod-notice aiopod-notice-info">
        <?php esc_html_e( 'Transcriptions improve accessibility and SEO, and let fans read along while the episode plays.', 'aio-podcast-studio' ); ?>
    </div>
    
    <!-- Field: Enable Transcription? -->
    <div id="aiopod-form-control-enable_transcription" class="aiopod-form-control">					
        <label class="aiopod-form-field">
            <input type="checkbox" name="enable_transcription" id="aiopod-field-enable_transcription" value="1" <?php checked( $enable_transcription, 1 ); ?> />
            <?php esc_html_e( 'Enable Transcription?', 'aio-podcast-studio' ); ?>
        </label>						
    </div>

    <!-- Field: Transcription Text -->
    <div id="aiopod-form-control-transcription" class="aiopod-form-control"<?php if ( empty( $enable_transcription ) ) { echo ' style="display:none;"'; } ?>>
        <label for="aiopod-field-transcription" class="aiopod-form-label">
            <?php esc_html_e( 'Transcription Text', 'aio-podcast-studio' ); ?>
        </label>
        
        <div class="aiopod-form-field">
            <textarea name="transcription" id="aiopod-field-transcription" class="widefat" rows="6"><?php echo esc_textarea( $transcription ); ?></textarea>
        </div>
        
        <p class="description">
            <?php esc_html_e( 'Paste or type the full transcript of your episode here.', 'aio-podcast-studio' ); ?>
        </p>
    </div>
</div>