This commit is contained in:
eric
2026-03-16 05:41:47 -05:00
parent ff31ef8001
commit c54d46517c
16 changed files with 796 additions and 286 deletions

View File

@@ -1,5 +1,7 @@
"use client";
import { HONGSHAN_COORDS } from "@/config/home.config";
interface AddressLinkProps {
place: string;
city: string;
@@ -8,8 +10,10 @@ interface AddressLinkProps {
/** 可点击的地址,点击打开地图(使用 span 避免嵌套在 Link 内时的 a 标签冲突) */
export default function AddressLink({ place, city, className = "" }: AddressLinkProps) {
const query = encodeURIComponent(`${city}${place}`);
const mapUrl = `https://www.google.com/maps/search/?api=1&query=${query}`;
const isHongshan = place.includes("红山");
const mapUrl = isHongshan
? `https://www.google.com/maps?q=${HONGSHAN_COORDS.lat},${HONGSHAN_COORDS.lng}`
: `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(`${city}${place}`)}`;
return (
<span