UNPKG

@pagamio/frontend-commons-lib

Version:

Pagamio library for Frontend reusable components like the form engine and table container

13 lines (12 loc) 1.51 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import AppBanner from './AppBanner'; import { AuthCard } from './AuthCard'; export function AuthPageLayout({ title, subtitle, errorMessage, showLogo = true, logo = { src: '/images/login-screen-logo.svg', alt: 'Pagamio Logo', width: 280, height: 250, className: 'mb-[2.5em]', }, renderInAppLayout = false, className = '', horizontal = true, children, appLabel, }) { return (_jsxs("div", { className: `-my-4 mx-auto flex w-full max-w-[640px] flex-col items-center justify-center px-4 py-8 sm:px-6 ${renderInAppLayout ? 'h-[calc(100vh-64px)]' : 'min-h-screen md:h-screen'} ${className}`, children: [showLogo && logo && (_jsxs("div", { className: "flex flex-col items-center mb-5", children: [_jsx("img", { src: logo.src, alt: logo.alt, width: logo.width, height: logo.height }), _jsx(AppBanner, { text: appLabel })] })), _jsxs(AuthCard, { className: "p-2 sm:p-3", horizontal: horizontal, children: [_jsxs("div", { children: [_jsx("h2", { "data-testid": "auth-page-title", className: "text-[1.5em] font-bold text-gray-900 dark:text-white sm:text-[1.875em]", children: title }), _jsx("h2", { "data-testid": "auth-page-subtitle", className: "text-[1em] font-medium text-gray-600 dark:text-white sm:text-[1em]", children: subtitle })] }), errorMessage && (_jsx("div", { "data-testid": "login-error-alert", className: "mt-4 rounded border border-red-400 bg-red-100 p-2 text-red-700", children: errorMessage })), children] })] })); }