32 lines
912 B
JavaScript
32 lines
912 B
JavaScript
'use client';
|
|
|
|
import { useRouter } from 'next/navigation';
|
|
import { Button } from '@zen/core/shared/components';
|
|
|
|
const AdminHeader = ({ title, description, backHref, backLabel = '← Retour', action }) => {
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<div className="flex items-center justify-between">
|
|
<div className="flex items-center gap-3">
|
|
<div>
|
|
<h1 className="text-lg sm:text-xl font-semibold text-neutral-900 dark:text-white">{title}</h1>
|
|
{description && (
|
|
<p className="mt-1 text-[13px] text-neutral-500 dark:text-neutral-400">{description}</p>
|
|
)}
|
|
</div>
|
|
</div>
|
|
<div className='flex gap-2'>
|
|
{backHref && (
|
|
<Button variant="secondary" onClick={() => router.push(backHref)}>
|
|
{backLabel}
|
|
</Button>
|
|
)}
|
|
{action}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default AdminHeader;
|