43cf589613
Detect admin access after login and expose a header button that opens /admin via client-side routing so the session stays unlocked when returning to the app. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
590 B
TypeScript
24 lines
590 B
TypeScript
import { useTranslation } from 'react-i18next'
|
|
import { LayoutDashboard } from 'lucide-react'
|
|
|
|
interface AdminHeaderButtonProps {
|
|
onClick: () => void
|
|
}
|
|
|
|
export default function AdminHeaderButton({ onClick }: AdminHeaderButtonProps) {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
className="btn-icon skipper-badge"
|
|
onClick={onClick}
|
|
title={t('nav.admin')}
|
|
aria-label={t('nav.admin')}
|
|
>
|
|
<LayoutDashboard size={18} aria-hidden="true" />
|
|
<span className="skipper-badge__name">{t('nav.admin')}</span>
|
|
</button>
|
|
)
|
|
}
|