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

74 lines
2.5 KiB
TypeScript
Raw Normal View History

2025-03-27 13:18:14 +07:00
import {
AppstoreOutlined,
AuditOutlined,
LogoutOutlined,
UserOutlined,
} from '@ant-design/icons';
import { Button } from '../../atoms';
2025-03-27 07:46:15 +07:00
import { FC, ReactElement } from 'react';
import { Link, useLocation } from 'react-router-dom';
export const BackofficeSidebar: FC = (): ReactElement => {
const location = useLocation();
const isActive = (path: string) => location.pathname.includes(path);
return (
<aside className="w-[280px] bg-white min-h-screen py-[60px] px-[28px] shadow-xl flex flex-col justify-between">
2025-03-27 13:18:14 +07:00
<div className="flex flex-col gap-20 justify-between items-center">
2025-03-27 07:46:15 +07:00
{/* Logo */}
2025-03-27 13:18:14 +07:00
<img src="/logos/simple.svg" alt="IMPHNEN Logo" className="w-[150px]" />
2025-03-27 07:46:15 +07:00
{/* Navigation Menu */}
2025-03-27 13:18:14 +07:00
<nav className="flex flex-col gap-4 w-full">
2025-03-27 07:46:15 +07:00
<Link
to="/dashboard"
2025-03-27 13:18:14 +07:00
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
2025-03-27 07:46:15 +07:00
isActive('/dashboard')
2025-03-27 13:18:14 +07:00
? 'bg-primary-500 text-white rounded-md'
2025-03-27 07:46:15 +07:00
: 'text-gray-700 hover:bg-gray-100'
}`}
>
2025-03-27 13:18:14 +07:00
<AppstoreOutlined className="text-[20px]" />
<span className="text-p3 font-medium">Dashboard & Set Gacha</span>
2025-03-27 07:46:15 +07:00
</Link>
<Link
to="/users"
2025-03-27 13:18:14 +07:00
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
isActive('/accounts')
? 'bg-primary-500 text-white rounded-md'
2025-03-27 07:46:15 +07:00
: 'text-gray-700 hover:bg-gray-100'
}`}
>
2025-03-27 13:18:14 +07:00
<UserOutlined className="text-[20px]" />
<span className="text-p3 font-medium">Data Akun</span>
2025-03-27 07:46:15 +07:00
</Link>
<Link
to="/transactions"
2025-03-27 13:18:14 +07:00
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
2025-03-27 07:46:15 +07:00
isActive('/transactions')
2025-03-27 13:18:14 +07:00
? 'bg-primary-500 text-white rounded-md'
2025-03-27 07:46:15 +07:00
: 'text-gray-700 hover:bg-gray-100'
}`}
>
2025-03-27 13:18:14 +07:00
<AuditOutlined className="text-[20px]" />
<span className="text-p3 font-medium">Validasi Transaksi</span>
2025-03-27 07:46:15 +07:00
</Link>
</nav>
</div>
{/* Log Out Button */}
2025-03-27 13:18:14 +07:00
<div className="w-full">
<Button
variant="text"
className="items-start justify-start gap-3 px-[8px] py-[10px] text-gray-700 hover:text-red-500 transition-colors w-full"
>
<LogoutOutlined className="text-[20px]" />
<span className="text-p3 font-medium">Log Out</span>
</Button>
2025-03-27 07:46:15 +07:00
</div>
</aside>
);
};