PHP 8.2.30
Preview: logged-in.tsx Size: 1.15 KB
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/frontend/components/app/logged-in.tsx

import React from 'react'
import { CurrentUserNav, Box, CurrentUserNavProps } from '@adminjs/design-system'

import { CurrentAdmin } from '../../../current-admin.interface.js'
import { useTranslation } from '../../hooks/index.js'
import allowOverride from '../../hoc/allow-override.js'

export type LoggedInProps = {
  session: CurrentAdmin;
  paths: {
    logoutPath: string;
  };
}

const LoggedIn: React.FC<LoggedInProps> = (props) => {
  const { session, paths } = props
  const { translateButton } = useTranslation()

  const dropActions: CurrentUserNavProps['dropActions'] = [{
    label: translateButton('logout'),
    onClick: (event: Event): void => {
      event.preventDefault()
      window.location.href = paths.logoutPath
    },
    icon: 'LogOut',
  }]
  return (
    <Box flexShrink={0} data-css="logged-in">
      <CurrentUserNav
        name={session.email}
        title={session.title}
        avatarUrl={session.avatarUrl}
        dropActions={dropActions}
      />
    </Box>
  )
}

const OverridableLoggedIn = allowOverride(LoggedIn, 'LoggedIn')

export {
  OverridableLoggedIn as default,
  OverridableLoggedIn as LoggedIn,
  LoggedIn as OriginalLoggedIn,
}

Directory Contents

Dirs: 6 × Files: 17

Name Size Perms Modified Actions
- drwxr-xr-x 2026-02-28 00:32:46
Edit Download
- drwxr-xr-x 2026-02-28 00:32:50
Edit Download
- drwxr-xr-x 2026-02-28 00:32:46
Edit Download
- drwxr-xr-x 2026-02-28 00:32:48
Edit Download
sidebar DIR
- drwxr-xr-x 2026-02-28 00:32:50
Edit Download
utils DIR
- drwxr-xr-x 2026-02-28 00:32:48
Edit Download
383 B lrw-r--r-- 2026-02-28 00:32:46
Edit Download
235 B lrw-r--r-- 2026-02-28 00:32:46
Edit Download
525 B lrw-r--r-- 2026-02-28 00:32:46
Edit Download
2.47 KB lrw-r--r-- 2026-02-28 00:32:46
Edit Download
3.21 KB lrw-r--r-- 2026-02-28 00:32:46
Edit Download
5.74 KB lrw-r--r-- 2026-02-28 00:32:46
Edit Download
3.51 KB lrw-r--r-- 2026-02-28 00:32:46
Edit Download
966 B lrw-r--r-- 2026-02-28 00:32:46
Edit Download
2.25 KB lrw-r--r-- 2026-02-28 00:32:46
Edit Download
4.08 KB lrw-r--r-- 2026-02-28 00:32:46
Edit Download
282 B lrw-r--r-- 2026-02-28 00:32:46
Edit Download
755 B lrw-r--r-- 2026-02-28 00:32:28
Edit Download
1.15 KB lrw-r--r-- 2026-02-28 00:32:48
Edit Download
3.27 KB lrw-r--r-- 2026-02-28 00:32:48
Edit Download
1.55 KB lrw-r--r-- 2026-02-28 00:32:50
Edit Download
1.71 KB lrw-r--r-- 2026-02-28 00:32:50
Edit Download
1.22 KB lrw-r--r-- 2026-02-28 00:32:50
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).