def generate_table_head
        labels = []

        if @args[:head] && @args[:head].length > 0
          # manage case with custom head
          labels = []
          if @args[:actions_on_start] && @show_row_actions
            labels.push(LANGUAGES[:lato_core][:mixed][:actions])
          end
          @args[:head].each do |head|
            if head.is_a?(Hash)
              sort_value = @args[:records].is_a?(Hash) ? @args[:records][:sort] : ''
              sort_dir_value = @args[:records].is_a?(Hash) ? @args[:records][:sort_dir] : 'ASC'
              active_class = sort_value == head[:sort] ? "attr-active attr-sort-#{sort_dir_value}" : ''
              active_sort = sort_value == head[:sort] ? (sort_dir_value == 'ASC' ? 'DESC' : 'ASC') : sort_dir_value
              search_value = @args[:records].is_a?(Hash) ? @args[:records][:search] : ''

              url = core__add_param_to_url(@args[:index_url], 'widget_index[search]', search_value)
              url = core__add_param_to_url(url, 'widget_index[sort]', head[:sort])
              url = core__add_param_to_url(url, 'widget_index[sort_dir]', active_sort)
              string = "<a href='#{url}' class='#{active_class}'>#{head[:label]}</a>"
              labels.push(string)
            else
              labels.push(head)
            end
          end
          if !@args[:actions_on_start] && @show_row_actions
            labels.push(LANGUAGES[:lato_core][:mixed][:actions])
          end
        elsif @records&.length > 0
          # manage case without custom head
          labels = []
          if @args[:actions_on_start] && @show_row_actions
            labels.push(LANGUAGES[:lato_core][:mixed][:actions])
          end
          labels = labels + @records.first.attributes.keys.map {|s| s.gsub('_', ' ')}
          labels = labels.map(&:capitalize)
          if !@args[:actions_on_start] && @show_row_actions
            labels.push(LANGUAGES[:lato_core][:mixed][:actions])
          end
        end

        return LatoCore::Elements::Table::Head::Cell.new(labels: labels)
      end
def generate_table_head
        labels = []

        if @args[:head] && @args[:head].length > 0
          # manage case with custom head
          labels = []
          if @args[:actions_on_start] && @show_row_actions
            labels.push(LANGUAGES[:lato_core][:mixed][:actions])
          end
          @args[:head].each do |head|
            if head.is_a?(Hash)
              sort_value = @args[:records].is_a?(Hash) ? @args[:records][:sort] : ''
              sort_dir_value = @args[:records].is_a?(Hash) ? @args[:records][:sort_dir] : 'ASC'
              active_class = sort_value == head[:sort] ? "attr-active attr-sort-#{sort_dir_value}" : ''
              active_sort = sort_value == head[:sort] ? (sort_dir_value == 'ASC' ? 'DESC' : 'ASC') : sort_dir_value
              search_value = @args[:records].is_a?(Hash) ? @args[:records][:search] : ''

              url = core__add_param_to_url(@args[:index_url], 'widget_index[search]', search_value)
              url = core__add_param_to_url(url, 'widget_index[sort]', head[:sort])
              url = core__add_param_to_url(url, 'widget_index[sort_dir]', active_sort)
              string = "<a href='#{url}' class='#{active_class}'>#{head[:label]}</a>"
              labels.push(string)
            else
              labels.push(head)
            end
          end
          if !@args[:actions_on_start] && @show_row_actions
            labels.push(LANGUAGES[:lato_core][:mixed][:actions])
          end
        elsif @records&.length > 0
          # manage case without custom head
          labels = []
          if @args[:actions_on_start] && @show_row_actions
            labels.push(LANGUAGES[:lato_core][:mixed][:actions])
          end
          labels = labels + @records.first.attributes.keys.map {|s| s.gsub('_', ' ')}
          labels = labels.map(&:capitalize)
          if !@args[:actions_on_start] && @show_row_actions
            labels.push(LANGUAGES[:lato_core][:mixed][:actions])
          end
        end

        return LatoCore::Elements::Table::Head::Cell.new(labels: labels)
      end
This function generate the head for the table.