Files
imphnen-frontend-service/libs/ui/src/organisms/backoffice-wrapper/backoffice-wrapper.tsx
T

68 lines
1.7 KiB
TypeScript
Raw Normal View History

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 = {
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 => {
const { session } = useAuthStore();
const user = session?.user;
2025-08-20 21:58:28 +07:00
return (
<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">
<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">
<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>
<section>{children}</section>
2025-08-20 21:58:28 +07:00
</main>
);
};