This commit is contained in:
@@ -8,15 +8,21 @@ import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import MainArea from '@/components/layout/MainArea'
|
||||
import { toast } from '@/components/ui/use-toast'
|
||||
import { API_BASE_URL, SITE_TITLE } from '@/config'
|
||||
import Forbidden from '@/pages/Forbidden'
|
||||
|
||||
import 'react-markdown-editor-lite/lib/index.css'
|
||||
|
||||
import type { WikiPage } from '@/types'
|
||||
import type { User, WikiPage } from '@/types'
|
||||
|
||||
const mdParser = new MarkdownIt
|
||||
|
||||
type Props = { user: User | null }
|
||||
|
||||
|
||||
export default ({ user }: Props) => {
|
||||
if (!(['admin', 'member'].some (r => user?.role === r)))
|
||||
return <Forbidden />
|
||||
|
||||
export default () => {
|
||||
const location = useLocation ()
|
||||
const navigate = useNavigate ()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user