mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 14:37:13 +01:00
18 lines
336 B
TypeScript
18 lines
336 B
TypeScript
import { useContext } from 'react'
|
|
|
|
import UserContext from './user/context'
|
|
|
|
export default function User() {
|
|
const { username, role } = useContext(UserContext)
|
|
|
|
if (!username || !role) {
|
|
return <div />
|
|
}
|
|
|
|
return (
|
|
<div className="font-extrabold bg-red-400 px-2 py-1 mr-3 rounded-sm">
|
|
{username}
|
|
</div>
|
|
)
|
|
}
|