PHP 8.2.30
Preview: test-context-provider.tsx Size: 996 B
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/frontend/components/spec/test-context-provider.tsx

import React, { ReactNode } from 'react'
import { StaticRouter } from 'react-router-dom/server.js'
import { combineStyles } from '@adminjs/design-system'
// @ts-ignore Note: Ignore while @adminjs/design-system/styled-components doesn't export types
import { ThemeProvider } from '@adminjs/design-system/styled-components'
import { I18nextProvider } from 'react-i18next'

import { defaultLocale } from '../../../locale/index.js'
import initTranslations from '../../utils/adminjs.i18n.js'

const theme = combineStyles({})

type Props = {
  children: ReactNode;
  location?: string;
}

const TestContextProvider: React.FC<Props> = (props) => {
  const { children, location } = props
  const { i18n } = initTranslations(defaultLocale)

  return (
    <ThemeProvider theme={theme}>
      <I18nextProvider i18n={i18n}>
        <StaticRouter location={location || '/'}>
          {children}
        </StaticRouter>
      </I18nextProvider>
    </ThemeProvider>
  )
}

export default TestContextProvider

Directory Contents

Dirs: 0 × Files: 8

Name Size Perms Modified Actions
543 B lrw-r--r-- 2026-02-28 00:31:58
Edit Download
298 B lrw-r--r-- 2026-02-28 00:32:10
Edit Download
127 B lrw-r--r-- 2026-02-28 00:32:28
Edit Download
283 B lrw-r--r-- 2026-02-28 00:32:38
Edit Download
876 B lrw-r--r-- 2026-02-28 00:32:40
Edit Download
1.17 KB lrw-r--r-- 2026-02-28 00:32:40
Edit Download
1.65 KB lrw-r--r-- 2026-02-28 00:32:42
Edit Download
996 B lrw-r--r-- 2026-02-28 00:32:50
Edit Download

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