feat: clean up Preistraeger detail structure by removing unused fields and updating related migrations

This commit is contained in:
syntaxbullet
2026-07-13 22:46:35 +02:00
parent 50b1cb6e2e
commit e28666fc47
8 changed files with 124 additions and 100 deletions

View File

@@ -18,7 +18,8 @@ const BG_ALT = '#E4E2E3';
const ARCHIVE_START_YEAR = 2007;
const ARCHIVE_END_YEAR = 2023;
const ARCHIVE_PERIOD = 'archive-2007-2023' as const;
const ARCHIVE_LABEL = `${ARCHIVE_START_YEAR}–${ARCHIVE_END_YEAR}`;
const ARCHIVE_RANGE_LABEL = `${ARCHIVE_START_YEAR}–${ARCHIVE_END_YEAR}`;
const ARCHIVE_TAB_LABEL = 'Bis 2023';
const GOLDENE_BAVARIA_GROUP = 'goldene-bavaria';
const PREISTRAEGER_GROUP = 'preistraeger';
@@ -165,7 +166,7 @@ export default function Preistraeger() {
const [activePeriod, setActivePeriod] = useState<WinnerPeriod | undefined>(undefined);
const selectedPeriod = activePeriod ?? periods[0] ?? ARCHIVE_PERIOD;
const isArchivePeriod = selectedPeriod === ARCHIVE_PERIOD;
const selectedPeriodLabel = isArchivePeriod ? ARCHIVE_LABEL : String(selectedPeriod);
const selectedPeriodLabel = isArchivePeriod ? ARCHIVE_RANGE_LABEL : String(selectedPeriod);
const filtered = useMemo(
() => winners.filter((winner) => isArchivePeriod ? isArchiveWinner(winner) : winner.year === selectedPeriod),
@@ -229,7 +230,7 @@ export default function Preistraeger() {
transition: 'color 0.15s, border-color 0.15s',
}}
>
{period === ARCHIVE_PERIOD ? ARCHIVE_LABEL : period}
{period === ARCHIVE_PERIOD ? ARCHIVE_TAB_LABEL : period}
</button>
))}
</div>