<div class="pure-u-1 pure-u-md-1-4">
    <div class="h-box">
    <% case item when %>
    <% when SearchChannel %>
        <a style="width:100%;" href="/channel/<%= item.ucid %>">
            <% if env.get("preferences").as(Preferences).thin_mode %>
            <% else %>
            <center>
                <img style="width:56.25%;" src="/ggpht<%= URI.parse(item.author_thumbnail).full_path %>"/>
            </center>
            <% end %>
            <p><%= item.author %></p>
        </a>
        <p><%= translate(locale, "`x` subscribers", number_with_separator(item.subscriber_count)) %></p>
        <p><%= translate(locale, "`x` videos", number_with_separator(item.video_count)) %></p>
        <h5><%= item.description_html %></h5>
    <% when SearchPlaylist %>
        <% if item.id.starts_with? "RD" %>
        <% url = "/mix?list=#{item.id}&continuation=#{item.thumbnail_id}" %>
        <% else %>
        <% url = "/playlist?list=#{item.id}" %>
        <% end %>
        <a style="width:100%;" href="<%= url %>">
            <% if env.get("preferences").as(Preferences).thin_mode %>
            <% else %>
            <div class="thumbnail">
                <img class="thumbnail" src="/vi/<%= item.thumbnail_id %>/mqdefault.jpg"/>
                <p class="length"><%= number_with_separator(item.video_count) %> videos</p>
            </div>
            <% end %>
            <p><%= item.title %></p>
        </a>
        <p>
            <b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
        </p>
    <% when MixVideo %>
        <a style="width:100%;" href="/watch?v=<%= item.id %>&list=<%= item.mixes[0] %>">
            <% if env.get("preferences").as(Preferences).thin_mode %>
            <% else %>
            <div class="thumbnail">
                <img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
                <% if item.length_seconds != 0 %>
                <p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
                <% end %>
            </div>
            <% end %>
            <p><%= item.title %></p>
        </a>
        <p>
            <b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
        </p>
    <% when PlaylistVideo %>
        <a style="width:100%;" href="/watch?v=<%= item.id %>&list=<%= item.playlists[0] %>">
            <% if env.get("preferences").as(Preferences).thin_mode %>
            <% else %>
            <div class="thumbnail">
                <img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
                <% if item.responds_to?(:live_now) && item.live_now %>
                <p class="length"><i class="icon ion-ios-play-circle"></i> <%= translate(locale, "LIVE") %></p>
                <% elsif item.length_seconds != 0 %>
                <p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
                <% end %>
            </div>
            <% end %>
            <p><%= item.title %></p>
        </a>
        <p>
            <b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
        </p>

        <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
        <h5><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5>
        <% elsif Time.now - item.published > 1.minute %>
        <h5><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></h5>
        <% end %>
    <% else %>
        <% if env.get("preferences").as(Preferences).thin_mode %>
        <% else %>
        <a style="width:100%;" href="/watch?v=<%= item.id %>">
            <div class="thumbnail">
                <img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
                <% if env.get? "show_watched" %>
                <p class="watched">
                    <a onclick="mark_watched(this)"
                        data-id="<%= item.id %>"
                        onmouseenter='this["href"]="javascript:void(0)"'
                        href="/mark_watched?id=<%= item.id %>">
                        <i onmouseenter='this.setAttribute("class", "icon ion-ios-eye-off")'
                           onmouseleave='this.setAttribute("class", "icon ion-ios-eye")'
                           class="icon ion-ios-eye">
                        </i>
                    </a>
                </p>
                <% end %>
                <% if item.responds_to?(:live_now) && item.live_now %>
                <p class="length"><i class="icon ion-ios-play-circle"></i> <%= translate(locale, "LIVE") %></p>
                <% elsif item.length_seconds != 0 %>
                <p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
                <% end %>
            </div>
        </a>
        <% end %>
        <p><a href="/watch?v=<%= item.id %>"><%= item.title %></a></p>
        <p>
            <b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
        </p>

        <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
        <h5><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5>
        <% elsif Time.now - item.published > 1.minute %>
        <h5><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></h5>
        <% end %>
    <% end %>
    </div>
</div>
