781512399b
Build & Deploy / Build & Push Docker Image (push) Successful in 2m51s
Test / Type Check (all packages) (push) Successful in 52s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Successful in 49s
Test / Homepage Unit Tests (push) Successful in 44s
Test / Storefront Unit Tests (push) Successful in 39s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 40s
Test / API Integration Tests (push) Successful in 1m0s
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
'use client'
|
|
|
|
import { localizedModePath, modeFromPathname, type Locale } from '@/lib/localization/config'
|
|
import Image from 'next/image'
|
|
import { usePathname } from 'next/navigation'
|
|
import type { ReactNode } from 'react'
|
|
import styles from './AuthShell.module.css'
|
|
|
|
interface AuthShellProps {
|
|
locale: Locale
|
|
title: string
|
|
subtitle?: string
|
|
children: ReactNode
|
|
}
|
|
|
|
export function AuthShell({ locale, title, subtitle, children }: AuthShellProps) {
|
|
const mode = modeFromPathname(usePathname())
|
|
return (
|
|
<main
|
|
id="main-content"
|
|
tabIndex={-1}
|
|
className={styles.main}
|
|
>
|
|
<div className={styles.container}>
|
|
<div className={styles.header}>
|
|
<a href={localizedModePath('home', locale, mode)}>
|
|
<Image
|
|
src="/rentaldrivego.png"
|
|
alt="RentalDriveGo"
|
|
width={96}
|
|
height={96}
|
|
priority
|
|
unoptimized
|
|
className={styles.logo}
|
|
/>
|
|
</a>
|
|
<h1 className={styles.title}>
|
|
{title}
|
|
</h1>
|
|
{subtitle ? (
|
|
<p className={styles.subtitle}>
|
|
{subtitle}
|
|
</p>
|
|
) : null}
|
|
</div>
|
|
|
|
<section className={styles.panel}>
|
|
{children}
|
|
</section>
|
|
</div>
|
|
</main>
|
|
)
|
|
}
|