feat: add project header
This commit is contained in:
parent
9a1f261850
commit
5946d625ca
40
app/components/projects/detail/project-header.tsx
Normal file
40
app/components/projects/detail/project-header.tsx
Normal file
@ -0,0 +1,40 @@
|
||||
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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user