mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: Header Role Indicator + Disable course creation wording if user isn't connected
This commit is contained in:
parent
a124cde229
commit
7398e9e946
9 changed files with 85 additions and 169 deletions
14
apps/web/components/ContentPlaceHolder.tsx
Normal file
14
apps/web/components/ContentPlaceHolder.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
'use client';
|
||||
import React from 'react'
|
||||
import useAdminStatus from './Hooks/useAdminStatus'
|
||||
|
||||
|
||||
// Terrible name and terible implementation, need to be refactored asap
|
||||
function ContentPlaceHolderIfUserIsNotAdmin({ text }: { text: string }) {
|
||||
const isUserAdmin = useAdminStatus() as any
|
||||
return (
|
||||
<div>{isUserAdmin ? text : 'No content yet'}</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ContentPlaceHolderIfUserIsNotAdmin
|
||||
Loading…
Add table
Add a link
Reference in a new issue