diff --git a/app/components/icons/chevron-double.tsx b/app/components/icons/chevron-double.tsx new file mode 100644 index 0000000..db9cadf --- /dev/null +++ b/app/components/icons/chevron-double.tsx @@ -0,0 +1,28 @@ +import type { JSX, SVGProps } from 'react' + +/** + * Note: `ChevronDoubleIcon` default mengarah ke kiri. + * Gunakan class `rotate-xx` untuk mengubah arah ikon. + */ +export const ChevronDoubleIcon = ( + properties: JSX.IntrinsicAttributes & SVGProps, +) => { + return ( + + + + ) +} diff --git a/app/components/icons/chevron-down.tsx b/app/components/icons/chevron.tsx similarity index 71% rename from app/components/icons/chevron-down.tsx rename to app/components/icons/chevron.tsx index c242f04..4161d77 100644 --- a/app/components/icons/chevron-down.tsx +++ b/app/components/icons/chevron.tsx @@ -1,6 +1,9 @@ import type { JSX, SVGProps } from 'react' - -export const ChevronDownIcon = ( +/** + * Note: `ChevronIcon` default mengarah ke bawah. + * Gunakan class `rotate-xx` untuk mengubah arah ikon. + */ +export const ChevronIcon = ( properties: JSX.IntrinsicAttributes & SVGProps, ) => { return ( @@ -10,6 +13,7 @@ export const ChevronDownIcon = ( viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg" + className={properties.className} {...properties} > void +} + +export const Pagination: React.FC = ({ + currentPage = 1, + totalPages, + onPageChange, +}) => { + const renderPageNumbers = () => { + const pages = [] + for (let index = 1; index <= totalPages; index++) { + pages.push( + , + ) + } + return pages + } + + return ( +
+ + + + {renderPageNumbers()} + + + +
+ ) +} diff --git a/app/layouts/admin/navbar.tsx b/app/layouts/admin/navbar.tsx index 1e81d0c..19b3396 100644 --- a/app/layouts/admin/navbar.tsx +++ b/app/layouts/admin/navbar.tsx @@ -1,6 +1,6 @@ import { Link } from 'react-router' -import { ChevronDownIcon } from '~/components/icons/chevron-down' +import { ChevronIcon } from '~/components/icons/chevron' import { NotificationIcon } from '~/components/icons/notification' import { useAdminContext } from '~/contexts/admin' import { APP } from '~/data/meta' @@ -26,7 +26,7 @@ export const Navbar = () => {
{adminProfile.name}
- + { + type TColorBadge = 'Baru' | 'Premium' | 'Pembayaran' + + const getStatusBadge = (status: TColorBadge) => { + const statusColors = { + Baru: 'bg-[#DFE5FF] text-[#4C5CA0]', + Premium: 'bg-[#FFFCAF] text-[#DBCA6E]', + Pembayaran: 'bg-[#FEC4FF] text-[#CC6EDB]', + } + return statusColors[status] || 'bg-gray-200 text-gray-700' + } + + return ( +
+
+
+

User

+
+
+ {/* filter section */} + +
+
+ + +
+ +
+ +
+
+
+
+ +
+ + + + +
+
+ + {/* table */} +
+
+

Daftar User

+ + + + + + + + + + + + + {USERS.map((user, index) => ( + + + + + + + + + ))} + +
NoTanggal DaftarNama UserEmailKategoriStatus
{index + 1}{user.date} + {user.name} +
id: 5512446588
+
{user.email}{user.category} + + {user.status} + +
+
+ + {/* pagination */} +
+ {}} + /> +
+
+
+ ) +} diff --git a/app/routes/_layout.admin.dashboard.users.tsx b/app/routes/_layout.admin.dashboard.users.tsx index 87ac591..e3edc82 100644 --- a/app/routes/_layout.admin.dashboard.users.tsx +++ b/app/routes/_layout.admin.dashboard.users.tsx @@ -1,4 +1,6 @@ +import { UsersPage } from '~/pages/dashboard-users' + const DashboardUsersLayout = () => { - return
Users Page
+ return } export default DashboardUsersLayout