13 lines
388 B
React
13 lines
388 B
React
"use client";
|
|
import {useEffect} from 'react';
|
|
import links from '../../../../data/shortlinks.json';
|
|
export function Shortlinks(){
|
|
useEffect(()=>{
|
|
const id=new URLSearchParams(location.search).get('p');
|
|
if(!id||!Object.hasOwn(links,id))return;
|
|
const target=links[id];
|
|
if(typeof target==='string'&&target.startsWith('/articles/'))location.replace(target);
|
|
},[]);
|
|
return null;
|
|
}
|