Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

925 B
Raw Blame
import type { ReactNode } from 'react';
import { useTranslation } from '../../i18n';
import DemoLock from '../Demo/DemoLock';
import { useDemoAccountLock } from '../Demo/useDemoLock';

/**
 * The account cards under the demo lock, on the desktop tab and the phone
 * screen alike. Every visitor of a demo instance signs in as the one shared
 * demo account, so its profile, password, two factor setup and passkeys stay
 * on view but out of reach, while the admin of a demo instance and every
 * account of a real one get the cards as they are. Both views wrap their
 * cards in this, so whom the lock holds and the reason it gives are written
 * once.
 */
export default function AccountDemoLock({ children }: { children: ReactNode }) {
  const { t } = useTranslation();
  const locked = useDemoAccountLock();
  return (
    <DemoLock locked={locked} reason={t('demo.lock.account')}>
      {children}
    </DemoLock>
  );
}