<?php
/**
 * WeCodeArt Framework.
 *
 * WARNING: This file is part of the core WeCodeArt Framework. DO NOT edit this file under any circumstances.
 * Please do all modifications in the form of a child theme.
 *
 * @package 	WeCodeArt Framework
 * @subpackage 	Entry\Meta\AuthorName
 * @since 		5.5.5
 * @version		6.4.5
 */

defined( 'ABSPATH' ) || exit;

use function WeCodeArt\Functions\get_prop;

/**
 * @param   object  $author Author
 * @param   array   $attributes Contains the Block attributes
 */

$attributes = isset( $attributes ) ? $attributes : [];
$classnames = [];

if( $value = get_prop( $attributes, 'textAlign' ) ) {
    $classnames[] = 'has-text-align-' . $value;
}

?>
<div <?php echo get_block_wrapper_attributes( [ 'class' => implode( ' ', $classnames ) ] ); ?>>
    <?php 
    
    wecodeart( 'dom' )->SVG::render( 'user', [
        'class' => 'wp-block-post-author__icon fa-fw'
    ] );
    
    ?>
    <?php if( get_prop( $attributes, 'isLink', true ) ) : ?>
    <a class="wp-block-post-author__link" href="<?php echo esc_url( $author->url ); ?>" rel="author">
    <?php endif; ?>
        <span class="wp-block-post-author__name"><?php
        
        echo esc_html( $author->name ); 

        ?></span>
    <?php if( get_prop( $attributes, 'isLink', true ) ) : ?>
    </a>
    <?php endif; ?>
</div>