---
import CollectionListView from "@/components/CollectionListView.astro"
import { getI18n } from '@/lib/i18n'
import { buildYearOptions } from "@/lib/filters"
const { t } = getI18n(Astro)
// 年份筛选:近 10 年(含当年),末项兜底(与走秀共用 lib/filters.ts)
const yearOptions = buildYearOptions()
// 排序选项:image_count 默认(按图片数降序)/ year_desc / year_asc
const sortOptions: { value: string; label: string }[] = [
{ value: "image_count", label: t('Most photos') },
{ value: "year_desc", label: t('Newest year') },
{ value: "year_asc", label: t('Oldest year') },
]
// 地区筛选:值即后端 street_snap.city 列存储的规范英文名(与 backfill_city 词典保持一致)。
// 标签用 t(city) —— 英文环境回退显示英文(巴黎→Paris),中文环境显示中文(Paris→巴黎)。
const cityOptions: { value: string; label: string }[] = [
{ value: "Paris", label: t('Paris') },
{ value: "New York", label: t('New York') },
{ value: "Milan", label: t('Milan') },
{ value: "London", label: t('London') },
{ value: "Copenhagen", label: t('Copenhagen') },
{ value: "Florence", label: t('Florence') },
{ value: "Berlin", label: t('Berlin') },
{ value: "Tokyo", label: t('Tokyo') },
{ value: "Seoul", label: t('Seoul') },
{ value: "Shanghai", label: t('Shanghai') },
{ value: "Beijing", label: t('Beijing') },
{ value: "Rome", label: t('Rome') },
{ value: "Madrid", label: t('Madrid') },
{ value: "Amsterdam", label: t('Amsterdam') },
{ value: "Antwerp", label: t('Antwerp') },
{ value: "Los Angeles", label: t('Los Angeles') },
{ value: "Moscow", label: t('Moscow') },
{ value: "Mumbai", label: t('Mumbai') },
]
// 通用筛选分组(year/sort/city)
const streetGroups = [
{ key: "year", title: t('Year'), options: yearOptions, selected: "selectedYear" },
{ key: "sort", title: t('Sort'), options: sortOptions, selected: "selectedSort" },
{ key: "city", title: t('City'), options: cityOptions, selected: "selectedCity" },
]
---