<script setup>
import { toCurrency } from 'src/filters';

defineProps({ row: { type: Object, required: true } });
</script>
<template>
    <span class="q-gutter-x-xs">
        <router-link
            v-if="row.claim?.claimFk"
            :to="{ name: 'ClaimBasicData', params: { id: row.claim?.claimFk } }"
            class="link"
        >
            <QIcon name="vn:claims" size="xs">
                <QTooltip>
                    {{ t('ticketSale.claim') }}:
                    {{ row.claim?.claimFk }}
                </QTooltip>
            </QIcon>
        </router-link>
        <QIcon
            v-if="row?.reserved"
            color="primary"
            name="vn:reserva"
            size="xs"
            data-cy="ticketSaleReservedIcon"
        >
            <QTooltip>
                {{ t('ticketSale.reserved') }}
            </QTooltip>
        </QIcon>
        <QIcon
            v-if="row?.hasRisk"
            name="vn:risk"
            :color="row.hasHighRisk ? 'negative' : 'primary'"
            size="xs"
        >
            <QTooltip>
                {{ $t('salesTicketsTable.risk') }}:
                {{ toCurrency(row.risk - (row.credit ?? 0)) }}
            </QTooltip>
        </QIcon>
        <QIcon
            v-if="row?.hasComponentLack"
            name="vn:components"
            color="primary"
            size="xs"
        >
            <QTooltip>{{ $t('salesTicketsTable.componentLack') }}</QTooltip>
        </QIcon>
        <QIcon v-if="row?.hasItemDelay" color="primary" size="xs" name="vn:hasItemDelay">
            <QTooltip>
                {{ $t('ticket.summary.hasItemDelay') }}
            </QTooltip>
        </QIcon>
        <QIcon v-if="row?.hasItemLost" color="primary" size="xs" name="vn:hasItemLost">
            <QTooltip>
                {{ $t('salesTicketsTable.hasItemLost') }}
            </QTooltip>
        </QIcon>
        <QIcon
            v-if="row?.hasItemShortage"
            name="vn:unavailable"
            color="primary"
            size="xs"
        >
            <QTooltip>{{ $t('salesTicketsTable.notVisible') }}</QTooltip>
        </QIcon>
        <QIcon v-if="row?.hasRounding" color="primary" name="sync_problem" size="xs">
            <QTooltip>
                {{ $t('ticketList.rounding') }}
            </QTooltip>
        </QIcon>
        <QIcon
            v-if="row?.hasTicketRequest"
            name="vn:buyrequest"
            color="primary"
            size="xs"
        >
            <QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
        </QIcon>
        <QIcon v-if="row?.isTaxDataChecked" name="vn:no036" color="primary" size="xs">
            <QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
        </QIcon>
        <QIcon v-if="row?.isFreezed" name="vn:frozen" color="primary" size="xs">
            <QTooltip>{{ $t('salesTicketsTable.clientFrozen') }}</QTooltip>
        </QIcon>
        <QIcon v-if="row?.isTooLittle" name="vn:isTooLittle" color="primary" size="xs">
            <QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
        </QIcon>
    </span>
</template>
