2025-12-05 11:55:28 +07:00
|
|
|
import { cn } from '@imphnen-frontend-service/utils';
|
|
|
|
|
import { Icon } from '@iconify/react';
|
|
|
|
|
import { FC, ReactElement, ReactNode } from 'react';
|
|
|
|
|
import { Button } from '../../atoms';
|
|
|
|
|
import { useAuthStore } from '@imphnen-frontend-service/service';
|
2025-08-20 21:58:28 +07:00
|
|
|
|
|
|
|
|
export type TBackofficeWrapperProps = {
|
2025-12-05 11:55:28 +07:00
|
|
|
children: ReactNode;
|
|
|
|
|
title?: string;
|
|
|
|
|
className?: string;
|
|
|
|
|
classHeader?: string;
|
|
|
|
|
classTitle?: string;
|
|
|
|
|
};
|
2025-08-20 21:58:28 +07:00
|
|
|
|
|
|
|
|
export const BackofficeWrapper: FC<TBackofficeWrapperProps> = ({
|
|
|
|
|
children,
|
|
|
|
|
title,
|
|
|
|
|
className,
|
|
|
|
|
classHeader,
|
|
|
|
|
classTitle,
|
|
|
|
|
}): ReactElement => {
|
2025-12-05 11:55:28 +07:00
|
|
|
const { session } = useAuthStore();
|
|
|
|
|
const user = session?.user;
|
|
|
|
|
|
2025-08-20 21:58:28 +07:00
|
|
|
return (
|
2025-12-05 11:55:28 +07:00
|
|
|
<main
|
|
|
|
|
className={cn(
|
|
|
|
|
'w-full px-[48px] py-[40px] flex flex-col gap-8',
|
|
|
|
|
className
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<header
|
|
|
|
|
className={cn(
|
|
|
|
|
'bg-white py-5 px-7 rounded-md shadow flex items-center justify-between',
|
|
|
|
|
classHeader
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<h1
|
|
|
|
|
className={cn(
|
|
|
|
|
'text-[19px] text-primary-500 font-semibold',
|
|
|
|
|
classTitle
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
{title}
|
|
|
|
|
</h1>
|
2025-08-20 21:58:28 +07:00
|
|
|
|
|
|
|
|
<div className="flex items-center gap-x-6">
|
|
|
|
|
<div className="flex items-center gap-x-6">
|
|
|
|
|
<div className="text-neutral-600 font-medium">
|
2025-12-05 11:55:28 +07:00
|
|
|
<p className="text-p3">{user?.fullname || 'Full Name'}</p>
|
|
|
|
|
<p className="text-label1">Admin</p>
|
2025-08-20 21:58:28 +07:00
|
|
|
</div>
|
|
|
|
|
<div className="size-12 rounded-full overflow-hidden">
|
2025-12-05 11:55:28 +07:00
|
|
|
<img
|
|
|
|
|
src={user?.avatar || '/images/asd687hwq6nds4dfjj2983.webp'}
|
|
|
|
|
alt="Profile"
|
|
|
|
|
className="size-full object-cover"
|
|
|
|
|
/>
|
2025-08-20 21:58:28 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
|
2025-12-05 11:55:28 +07:00
|
|
|
<section>{children}</section>
|
2025-08-20 21:58:28 +07:00
|
|
|
</main>
|
2025-12-05 11:55:28 +07:00
|
|
|
);
|
|
|
|
|
};
|