<%- thin_mode = env.get("preferences").as(Preferences).thin_mode item_watched = !item.is_a?(SearchChannel | SearchHashtag | SearchPlaylist | InvidiousPlaylist | Category) && env.get?("user").try &.as(User).watched.index(item.id) != nil author_verified = item.responds_to?(:author_verified) && item.author_verified -%>
<% case item when %> <% when SearchChannel %> <% if !thin_mode %>
" alt="" />
<%- else -%>
<% end %> <% if !item.channel_handle.nil? %>

<%= item.channel_handle %>

<% end %>

<%= translate_count(locale, "generic_subscribers_count", item.subscriber_count, NumberFormatting::Separator) %>

<% if !item.auto_generated && item.channel_handle.nil? %>

<%= translate_count(locale, "generic_videos_count", item.video_count, NumberFormatting::Separator) %>

<% end %>
<%= item.description_html %>
<% when SearchHashtag %> <% if !thin_mode %>
<%- else -%>
<% end %>
<%- if item.video_count != 0 -%>

<%= translate_count(locale, "generic_videos_count", item.video_count, NumberFormatting::Separator) %>

<%- end -%>
<%- if item.channel_count != 0 -%>

<%= translate_count(locale, "generic_channels_count", item.channel_count, NumberFormatting::Separator) %>

<%- end -%>
<% when SearchPlaylist, InvidiousPlaylist %> <%- if item.id.starts_with? "RD" link_url = "/mix?list=#{item.id}&continuation=#{URI.parse(item.thumbnail || "/vi/-----------").request_target.split("/")[2]}" else link_url = "/playlist?list=#{item.id}" end -%>
<%- if !thin_mode %> " alt="" /> <%- else -%>
<%- end -%>

<%= translate_count(locale, "generic_videos_count", item.video_count, NumberFormatting::Separator) %>

<% if !item.ucid.to_s.empty? %>

<%= HTML.escape(item.author) %> <%- if author_verified %> <% end -%>

<% else %>

<%= HTML.escape(item.author) %> <%- if author_verified %> <% end -%>

<% end %>
<% when Category %> <% else %> <%- # `endpoint_params` is used for the "video-context-buttons" component if item.is_a?(PlaylistVideo) link_url = "/watch?v=#{item.id}&list=#{item.plid}&index=#{item.index}" endpoint_params = "?v=#{item.id}&list=#{item.plid}" elsif item.is_a?(MixVideo) link_url = "/watch?v=#{item.id}&list=#{item.rdid}" endpoint_params = "?v=#{item.id}&list=#{item.rdid}" else link_url = "/watch?v=#{item.id}" endpoint_params = "?v=#{item.id}" end -%>
<%- if !thin_mode -%> <% if item_watched %>
<% end %>
<%- else -%>
<%- end -%>
<%- if env.get? "show_watched" -%>
" method="post"> ">
<%- end -%> <%- if plid_form = env.get?("add_playlist_items") -%> <%- form_parameters = "action_add_video=1&video_id=#{item.id}&playlist_id=#{plid_form}&referer=#{env.get("current_page")}" -%>
">
<%- elsif item.is_a?(PlaylistVideo) && (plid_form = env.get?("remove_playlist_items")) -%> <%- form_parameters = "action_remove_video=1&set_video_id=#{item.index}&playlist_id=#{plid_form}&referer=#{env.get("current_page")}" -%>
">
<%- end -%>
<%- if item.responds_to?(:live_now) && item.live_now -%>

 <%= translate(locale, "LIVE") %>

<%- elsif item.length_seconds != 0 -%>

<%= recode_length_seconds(item.length_seconds) %>

<%- end -%>
<% if !item.ucid.to_s.empty? %>

<%= HTML.escape(item.author) %> <%- if author_verified %> <% end -%>

<% else %>

<%= HTML.escape(item.author) %> <%- if author_verified %> <% end -%>

<% end %>
<%= rendered "components/video-context-buttons" %>
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp.try &.> Time.utc %>

<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %>

<% elsif item.responds_to?(:published) && (Time.utc - item.published) > 1.minute %>

<%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>

<% end %>
<% if item.responds_to?(:views) && item.views %>

<%= translate_count(locale, "generic_views_count", item.views || 0, NumberFormatting::Short) %>

<% end %>
<% end %>