Files
progcode/web/fsd/features/shortlinks/ui/Shortlinks.jsx
huncode 12562baeb5
Build and deploy / deploy (push) Successful in 2m39s
Implement ProgCode identity and real shared reading UI kit
2026-10-27 15:19:49 +03:00

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;
}