forked from rajun/ar-test
41 lines
1.7 KiB
TypeScript
41 lines
1.7 KiB
TypeScript
import { Pencil } from 'lucide-react';
|
|
import { AddButton } from '~/components/ui/add-button';
|
|
import { Button } from '~/components/ui/button';
|
|
import { LogoTile } from '~/components/ui/logo-tile';
|
|
import { PageBreadcrumb } from '~/components/ui/page-breadcrumb';
|
|
import { Text } from '~/components/ui/text';
|
|
import { ProjectMeta } from '~/components/projects/detail/project-meta';
|
|
import { ROUTES } from '~/data/routes';
|
|
import { toBrand } from '~/services/asset-media';
|
|
import type { Project } from '~/types/project';
|
|
|
|
interface ProjectHeaderProps {
|
|
project: Project;
|
|
assetCount: number;
|
|
onEdit: () => void;
|
|
onNewAsset: () => void;
|
|
}
|
|
|
|
export function ProjectHeader({ project, assetCount, onEdit, onNewAsset }: ProjectHeaderProps) {
|
|
return (
|
|
<>
|
|
<PageBreadcrumb trail={[{ label: 'Projects', to: ROUTES.projects }]} current={project.name} />
|
|
<div className='flex flex-wrap items-center gap-[22px]'>
|
|
<LogoTile brand={toBrand(project)} size='header' />
|
|
<div className='flex min-w-60 flex-1 flex-col gap-2'>
|
|
<Text as='h1' variant='display'>{project.name}</Text>
|
|
{project.description && <Text className='text-pretty'>{project.description}</Text>}
|
|
<ProjectMeta project={project} assetCount={assetCount} />
|
|
</div>
|
|
<div className='flex items-center gap-2.5'>
|
|
<Button variant='secondary' onClick={onEdit}>
|
|
<Pencil size={13} />
|
|
Edit project
|
|
</Button>
|
|
<AddButton label='New asset' onClick={onNewAsset} />
|
|
</div>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|