mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
feat: added Redirect component
This commit is contained in:
parent
555d1d17f8
commit
22e1f491f0
23
components/Redirect.tsx
Normal file
23
components/Redirect.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import dynamic from 'next/dynamic'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
import { redirectTo } from '@utils/Tools'
|
||||
|
||||
const Container = dynamic(() => import('@components/Container'))
|
||||
|
||||
const Redirect = ({ to }:RedirectProps):JSX.Element => {
|
||||
const router = useRouter()
|
||||
if(!to) throw new Error('No Link')
|
||||
redirectTo(router, to)
|
||||
return <Container paddingTop>
|
||||
<div>
|
||||
<a href={to} className='text-blue-400'>자동으로 리다이렉트되지 않는다면 클릭해세요.</a>
|
||||
</div>
|
||||
</Container>
|
||||
}
|
||||
|
||||
interface RedirectProps {
|
||||
to: string
|
||||
}
|
||||
|
||||
export default Redirect
|
||||
Loading…
x
Reference in New Issue
Block a user