<?php
    namespace Pixebuilder\Element;
    
    // prevent direct file access
	if( !defined( 'ABSPATH' ) ) exit;
    
    class Code_Display extends Item{

        static function get_name(){
            return 'code-display';
        }

        static function get_title(){
            return esc_html__('Code Display', 'pixebuilder');
        }

        static function get_icon(){
            return 'code';
        }
        
        static function render_content($settings){

            $atts = array();
            if( !empty($settings['typo']['preset']) ){
                $atts['typo-preset'] = $settings['typo']['preset'];
            }
            
            $ret = '';
            if( !empty($settings['text']) ){
                $ret  = '<pre class="pixe-inline" ';
                $ret .= pixe_get_data_atts($atts);
                $ret .= '>';
                $ret .= $settings['text'];
                $ret .= '</pre>';
            }

            return $ret;
        }

    }

    \Pixe_Builder::register_element('Pixebuilder\Element\Code_Display');
    