forked from rajun/ar-test
30 lines
1.3 KiB
TypeScript
30 lines
1.3 KiB
TypeScript
import { ClientLogo } from '~/components/ui/client-logo';
|
|
import { LogoMark } from '~/components/ui/logo-mark';
|
|
import { Text } from '~/components/ui/text';
|
|
import { cn } from '~/lib/utils';
|
|
import type { ArPageLayout, BrandIdentity } from '~/types/project';
|
|
|
|
interface ArPageHeaderProps {
|
|
brand?: BrandIdentity;
|
|
modelName: string;
|
|
layout: ArPageLayout;
|
|
// Placement, e.g. over the model
|
|
className?: string;
|
|
}
|
|
|
|
// Client logo top-left with the model name under it; the thob mark top-right. Each part can be turned off per project.
|
|
export function ArPageHeader({ brand, modelName, layout, className }: ArPageHeaderProps) {
|
|
return (
|
|
<header className={cn('flex items-start justify-between gap-3 px-4 pt-[calc(18px+env(safe-area-inset-top))]', className)}>
|
|
<div className='flex min-w-0 flex-col items-start gap-2.5'>
|
|
{brand && <ClientLogo brand={brand} variant={layout.logoBacking ? 'chip' : 'bare'} size='md' />}
|
|
{/* A hidden name stays for screen readers: it is the page heading */}
|
|
<Text as='h1' variant='subheading' tone='ink' truncate className={cn('max-w-full', !layout.modelName && 'sr-only')}>
|
|
{modelName}
|
|
</Text>
|
|
</div>
|
|
{layout.thobLogo && <LogoMark size='md' surface='viewer' />}
|
|
</header>
|
|
);
|
|
}
|