photo-detail.ts 1.42 KB
import type { GalleryPhoto } from "./gallery";

export interface CommentItem {
  id: number;
  user: string;
  content: string;
  date: string;
}

const milkSeaDetail = {
  description:
    "牛奶海(俄绒措)镶嵌在央迈勇神山脚下的高山湖泊,湖水澄澈如碧玉,随光线与云层变幻出层次丰富的碧蓝与翠绿。湖畔草甸与雪峰同框,是亚丁长线徒步中最令人屏息的一站,海拔约4600米,请量力而行、注意高反与天气变化。",
  comments: [
    {
      id: 1,
      user: "山行者",
      content: "这抹蓝太不真实了,和雪山一起像画一样。",
      date: "2026-03-19",
    },
    {
      id: 2,
      user: "摄影师小李",
      content: "请问是上午还是下午拍的?湖水颜色差好多。",
      date: "2026-03-19",
    },
    {
      id: 3,
      user: "藏地风情",
      content: "走长线累但值得,记得带够水和保暖,湖边风很大。",
      date: "2026-03-20",
    },
  ] as CommentItem[],
};

const genericDesc =
  "稻城亚丁自然风光摄影作品,记录高原雪山、海子与草甸的壮美瞬间。";

export function buildPhotoDetail(photo: GalleryPhoto) {
  const isMilkSea = photo.id === 2;
  return {
    ...photo,
    description: isMilkSea ? milkSeaDetail.description : genericDesc,
    date: "2026-03-18",
    comments: isMilkSea
      ? [...milkSeaDetail.comments]
      : ([] as CommentItem[]),
  };
}