's'
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user