{% if type is not defined %}
{% set route_name = 'auction_item' %}
{% elseif type == 'shop' %}
{% set route_name = 'shop_item' %}
{% elseif type == 'fund-a-need' %}
{% set route_name = 'fund_a_need_item' %}
{% else %}
{% set route_name = 'auction_item' %}
{% endif %}
{% set itemParams = campaignParams|merge({ itemId: item.id }) %}
<div class="auction-item-details d-flex align-items-start">
<div class="image">
{% if isPackagedItem is defined and isPackagedItem %}
<span class="image-container">
{% if item.primaryImage and item.primaryImage.image %}
<img src="{{ vich_uploader_asset(item.primaryImage.image, 'file') }}" />
{% else %}
<i class="far fa-image default-icon"></i>
{% endif %}
</span>
{% else %}
<a href="{{ path(route_name, itemParams) }}" class="image-container">
{% if item.primaryImage and item.primaryImage.image %}
<img src="{{ vich_uploader_asset(item.primaryImage.image, 'file') }}" />
{% else %}
<i class="far fa-image default-icon"></i>
{% endif %}
</a>
{% endif %}
</div>
<div class="info flex-grow-1">
{% if isPackagedItem is defined and isPackagedItem %}
<h6 class="my-1">{{ item.name }}</h6>
{% else %}
<a href="{{ path(route_name, itemParams) }}" class="name">
{{ item.name }}
</a>
{% endif %}
{% if item.donation %}
<div class="tag d-flex align-items-center">
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'tag-outline', size: 'small' } %}
<span>Donation</span>
</div>
{% elseif item.fixedPrice %}
<div class="tag d-flex align-items-center">
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'tag-outline', size: 'small' } %}
<span>Fixed Price Item</span>
</div>
<div class="price">
<strong>Price:</strong>
{{ item.buyItNowPrice|money }}
</div>
{% else %}
{% if isPackagedItem is not defined or not isPackagedItem %}
<div class="value">
<strong>Value:</strong>
{{ item.estimatedValueDisplay ? 'Priceless' : item.estimatedValue|money }}
</div>
{% endif %}
{% endif %}
{% if item.soldOut %}
<p class="text-danger">{{ item.auctionType ? 'Sold Out' : 'SOLD' }}</p>
{% endif %}
{% if item.auctionType and (isPackagedItem is not defined or not isPackagedItem) %}
<div class="bid-info">
{% if item.winningBid %}
{% if item.paidFor %}
<strong>Sold At:</strong>
{{ item.purchase.amount|money }}
{% else %}
<strong>Current Bid:</strong>
{{ item.winningBid.amount|money }}
{% endif %}
{% else %}
<strong>Starting Bid:</strong>
{{ item.minBid|money }}
{% endif %}
</div>
{% endif %}
{% if not item.auctionType and auction.showQtyRemaining %}
<div class="quantity">
{{ item.currentQuantity }} Items Remaining
</div>
{% endif %}
{% if not item.donorAnonymous %}
<div class="value">
<strong>Donor:</strong>
{% include '@BidcozFrontend/Auction/Item/_donor.html.twig' with {display_initial:true} %}
</div>
{% endif %}
<div class="auction-item-messages pt-0">
{% if isPackagedItem is defined and isPackagedItem %}
{{ item.description|raw }}
{% endif %}
{# if item.manualType %}
<div class="auction-item-message">Bidding at Event</div>
{% endif #}
{# include '@BidcozFrontend/Auction/_item_time.html.twig' with { listView: true } #}
</div>
</div>
<div class="actions">
<div class="buttons d-flex flex-column justify-content-between h-100">
{% if isPackagedItem is not defined or not isPackagedItem %}
<a href="{{ path(route_name, itemParams) }}" class="btn btn-sm full-width">
{% if organization.slug == 'nvidia' %}
Bid Now
{% else %}
View Details
{% endif %}
</a>
{% endif %}
{% if is_granted('AUCTION', campaign) %}
<a href="{{ path('auction_manage_item_edit', campaignParams|merge({ id: item.id })) }}" class="edit-link d-flex justify-content-end align-items-center" data-title="Edit Item: {{ item.name }}" data-submit="{{ path('auction_manage_item_update', campaignParams|merge({ id: item.id})) }}">
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'cog-outline', h: '1.5rem', w: '1.5rem' } %}
<span>Edit</span>
</a>
{% endif %}
</div>
</div>
{% if item.auctionType and (isPackagedItem is not defined or not isPackagedItem) %}
{% set totalBids = itemBidCount is defined ? itemBidCount : item.activeBids|length %}
<div class="badge {% if totalBids == 0 %}badge-default{% else %}badge-success{% endif %}">
{{ totalBids }} bid{{ totalBids == 1 ? '' : 's' }}
</div>
{% endif %}
{% if not item.auctionType and item.manualType %}
<div class="badge badge-success">
On-site
</div>
{% endif %}
</div>