Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 33x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 33x 33x 33x 33x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | <template>
<section
class="mb-4 rounded-lg border border-amber-300 dark:border-amber-700 border-l-4 border-l-amber-400 bg-amber-50 dark:bg-amber-950/40 px-3 sm:px-4 py-3"
data-testid="motd-banner"
:data-has-reasons="hasReasons ? 'true' : 'false'"
>
<!--
Tournament Match of the Day (SB-1560).
One pick per tournament, day and age group (SB-1750), shown only on the
day it is for; the page passes the pick for the age group being viewed,
or one banner per age group under All Ages. Unlike
the Match of the Week strip, this one opens by default: a tournament page
is the thing the visitor came for, and the pick is the day's headline.
Three states, by design (CLAUDE.md): no pick renders nothing at all — no
placeholder, no skeleton; a pick without reasons is the fixture and its
headline; reasons add the "Why" list.
-->
<div class="flex items-center gap-2 mb-1.5">
<span
class="text-xs font-bold uppercase tracking-wider text-amber-700 dark:text-amber-300"
>
<span aria-hidden="true">◆</span> Match of the Day
</span>
<span v-if="dayLabel" class="text-xs text-fg-muted" data-testid="motd-day"
>· {{ dayLabel }}</span
>
<span
v-if="ageGroupName"
class="ml-auto text-xs font-medium text-fg-muted"
data-testid="motd-age"
>{{ ageGroupName }}</span
>
</div>
<button
type="button"
class="w-full text-left group"
data-testid="motd-fixture"
@click="$emit('select-match', match)"
>
<div
class="flex flex-wrap items-baseline gap-x-2 text-base sm:text-lg font-bold text-fg group-hover:text-brand-700 dark:group-hover:text-brand-200"
>
<span>{{ homeName }}</span>
<span
v-if="hasScore"
class="font-mono tabular-nums"
data-testid="motd-score"
>{{ match.home_score }}–{{ match.away_score }}</span
>
<span v-else class="text-sm font-medium text-fg-muted">vs</span>
<span>{{ awayName }}</span>
</div>
<p
v-if="pick.blurb"
class="mt-0.5 text-sm text-fg"
data-testid="motd-blurb"
>
{{ pick.blurb }}
</p>
</button>
<div v-if="hasReasons" class="mt-2.5" data-testid="motd-reasons">
<h4
class="text-xs font-semibold uppercase tracking-wide text-amber-800 dark:text-amber-200 mb-1"
>
Why this is the Match of the Day
</h4>
<ul class="space-y-0.5">
<li
v-for="(reason, i) in pick.reasons"
:key="i"
class="flex gap-2 text-sm text-fg"
data-testid="motd-reason"
>
<span
class="text-amber-600 dark:text-amber-400 shrink-0"
aria-hidden="true"
>▸</span
>
<span>{{ reason.text }}</span>
</li>
</ul>
</div>
</section>
</template>
<script setup>
import { computed } from 'vue';
const props = defineProps({
// `{ match_date, blurb, reasons, match }` from GET /api/tournaments/{id}/motd.
pick: { type: Object, required: true },
// The tournament's own copy of the match, when the page has it: fresher
// scores than the pick's snapshot, since realtime keeps the list current.
liveMatch: { type: Object, default: null },
dayLabel: { type: String, default: '' },
});
defineEmits(['select-match']);
const match = computed(() => props.liveMatch || props.pick.match || {});
const homeName = computed(
() => match.value.home_team?.name || match.value.home_team_name || 'TBD'
);
const awayName = computed(
() => match.value.away_team?.name || match.value.away_team_name || 'TBD'
);
const ageGroupName = computed(
() => match.value.age_group?.name || match.value.age_group_name || ''
);
// Absent is not zero: an unplayed match shows "vs", never 0–0.
const hasScore = computed(
() => match.value.home_score != null && match.value.away_score != null
);
// null (never written) and [] (written, empty) both render no "Why" section;
// the distinction lives in the data for the adoption funnel, not on screen.
const hasReasons = computed(
() => Array.isArray(props.pick.reasons) && props.pick.reasons.length > 0
);
</script>
|