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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | 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 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 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 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 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 15x 15x 15x 15x 30x 30x 30x 30x 30x 30x 30x 30x 15x 1x 1x 15x 1x 1x 1x 1x 32x 32x 1x 1x 11x 11x 11x 11x 1x 1x 1x | <template>
<!--
The Scouting tab (SB-1782), as a tale of the tape (SB-1906): both teams
side by side, row by row, in a League block and an equal Flex block
(SB-1914), then each team's details below.
Fest teams come from different conferences, so each value is measured in
its own team's table, and the panel says so. Absent is "—", never 0.
-->
<div class="flex flex-col gap-4" data-testid="scouting-compare">
<!-- The two teams -->
<div class="grid grid-cols-2 gap-3 sm:gap-6 items-start">
<div
v-for="t in teams"
:key="t.role"
class="flex flex-col gap-1.5 min-w-0"
:class="t.role === 'away' ? 'items-end text-right' : 'items-start'"
:data-testid="`scouting-compare-${t.role}`"
>
<div
class="flex items-center gap-2 min-w-0 max-w-full"
:class="t.role === 'away' ? 'flex-row-reverse' : ''"
>
<ClubLogo :logo-url="t.logoUrl" :name="t.clubName" size="sm" />
<h3
class="m-0 text-sm sm:text-base font-bold text-fg leading-tight break-words min-w-0"
data-testid="scouting-team-name"
>
{{ t.name }}
</h3>
</div>
<span
v-if="t.proAcademy"
class="rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wide bg-accent-100 text-accent-700 dark:bg-accent-900/50 dark:text-accent-300"
data-testid="scouting-pro-academy"
>PRO ACADEMY</span
>
</div>
</div>
<!-- Row by row: League, then Flex, the same size (SB-1914) -->
<div v-if="sections.length">
<section
v-for="sec in sections"
:key="sec.key"
class="border-t border-line"
:data-testid="`scouting-section-${sec.key}`"
>
<div
class="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-end gap-2 sm:gap-4 pt-3 pb-2 border-b border-line"
>
<p
class="m-0 text-xs text-fg-muted min-w-0 break-words"
data-testid="scouting-compare-table"
>
<template v-if="sec.home">{{ tableName(sec, sec.home) }}</template>
<template v-else>No {{ sec.title }} table</template>
</p>
<h4
class="m-0 text-xs sm:text-sm font-extrabold uppercase tracking-wider text-fg text-center"
>
{{ sec.title }}
</h4>
<p
class="m-0 text-xs text-fg-muted min-w-0 break-words text-right"
data-testid="scouting-compare-table"
>
<template v-if="sec.away">{{ tableName(sec, sec.away) }}</template>
<template v-else>No {{ sec.title }} table</template>
</p>
</div>
<div
v-for="row in sec.rows"
:key="row.key"
class="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-2 sm:gap-4 min-h-[48px] border-b border-line"
:data-testid="`scouting-compare-row-${row.key}`"
>
<div class="flex items-center gap-3 min-w-0">
<span
class="text-base sm:text-xl font-extrabold tabular-nums whitespace-nowrap"
:class="row.better === 'away' ? 'text-fg-muted' : 'text-fg'"
data-testid="scouting-compare-home-value"
>{{ row.home }}</span
>
<span
v-if="row.bars"
class="hidden sm:flex flex-1 h-2 rounded-full bg-surface-alt justify-end overflow-hidden"
aria-hidden="true"
>
<span
class="h-2 rounded-full"
:class="barClass(row, 'home')"
:style="{ width: `${row.bars.home}%` }"
></span>
</span>
</div>
<span
class="text-xs sm:text-sm font-semibold text-fg-muted text-center"
>{{ row.label }}</span
>
<div class="flex flex-row-reverse items-center gap-3 min-w-0">
<span
class="text-base sm:text-xl font-extrabold tabular-nums whitespace-nowrap"
:class="row.better === 'home' ? 'text-fg-muted' : 'text-fg'"
data-testid="scouting-compare-away-value"
>{{ row.away }}</span
>
<span
v-if="row.bars"
class="hidden sm:flex flex-1 h-2 rounded-full bg-surface-alt overflow-hidden"
aria-hidden="true"
>
<span
class="h-2 rounded-full"
:class="barClass(row, 'away')"
:style="{ width: `${row.bars.away}%` }"
></span>
</span>
</div>
</div>
</section>
<div
v-if="formCount"
class="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-2 sm:gap-4 min-h-[52px] border-b border-line"
data-testid="scouting-compare-row-form"
>
<ScoutingFormStrip :form="home.dossier?.form || []" />
<span class="text-xs sm:text-sm font-semibold text-fg-muted text-center"
>Last {{ formCount }}</span
>
<ScoutingFormStrip :form="away.dossier?.form || []" align="end" />
</div>
<p class="m-0 mt-2 text-[11px] text-fg-muted">
Each team is measured in its own conference. Conferences only meet at
tournaments.
</p>
</div>
<!-- Each team's details -->
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<ScoutingDossierColumn
:side="home"
:teamName="homeTeamName"
role="home"
/>
<ScoutingDossierColumn
:side="away"
:teamName="awayTeamName"
role="away"
/>
</div>
</div>
</template>
<script setup>
import { computed } from 'vue';
import ClubLogo from '../shared/ClubLogo.vue';
import ScoutingDossierColumn from './ScoutingDossierColumn.vue';
import ScoutingFormStrip from './ScoutingFormStrip.vue';
import {
conferenceName,
kindLabel,
scoutingSections,
} from '../../utils/scoutingCompare';
const props = defineProps({
/** The two MatchupSides from GET /api/matches/{id}/matchup. */
home: { type: Object, required: true },
away: { type: Object, required: true },
homeTeamName: { type: String, default: '' },
awayTeamName: { type: String, default: '' },
});
const usable = side =>
side?.dossier && !side.dossier.error ? side.dossier : null;
const teams = computed(() =>
[
['home', props.home, props.homeTeamName],
['away', props.away, props.awayTeamName],
].map(([role, side, fallback]) => {
const team = usable(side)?.team;
return {
role,
name: team?.name || fallback,
clubName: team?.club_name || team?.name || fallback,
logoUrl: team?.logo_url || '',
proAcademy: Boolean(team?.pro_academy),
};
})
);
const sections = computed(() =>
scoutingSections(usable(props.home), usable(props.away))
);
// "Pro Player Pathway · Northeast" in the League block; just the conference in
// the Flex block, whose title already says Flex.
const tableName = (sec, line) =>
sec.key === 'flex'
? conferenceName(line)
: `${kindLabel(line)} · ${conferenceName(line)}`;
const formCount = computed(() =>
Math.max(
usable(props.home)?.form?.length || 0,
usable(props.away)?.form?.length || 0
)
);
const barClass = (row, role) =>
row.better === role ? 'bg-brand-600 dark:bg-brand-300' : 'bg-fg-muted/40';
</script>
|