import * as React from 'react'; import { FC, ReactElement, useState } from 'react'; import { FilterOutlined, SearchOutlined, EditOutlined, } from '@ant-design/icons'; import { Button, Input } from '@imphnen-frontend-service/ui/atoms'; import { DataTable, Filter } from '@imphnen-frontend-service/ui/organisms'; import { ColumnDef, getCoreRowModel, getPaginationRowModel, PaginationState, useReactTable, RowSelectionState, } from '@tanstack/react-table'; interface Account { id: number; name: string; email: string; phone: string; address: string; } // Mock data for demonstration const mockData: Account[] = Array.from({ length: 90 }, (_, i) => ({ id: i + 1, name: i === 0 ? 'Ahmad Wijuana' : 'Nama Lengkap', email: 'fullname23@gmail.com', phone: '081904423804', address: 'Jl. Pantai Cibaduyut Indah', })); const columns: ColumnDef[] = [ { id: 'select', header: ({ table }) => ( ), cell: ({ row }) => ( ), }, { header: 'No', accessorKey: 'id', }, { header: 'Nama Lengkap', accessorKey: 'name', }, { header: 'Email', accessorKey: 'email', }, { header: 'Nomor Telp', accessorKey: 'phone', }, { header: 'Alamat Pengiriman', accessorKey: 'address', }, { header: 'Action', cell: ({ row }) => ( ), }, ]; export const Components: FC = (): ReactElement => { const [pagination, setPagination] = React.useState({ pageIndex: 0, pageSize: 9, }); const [rowSelection, setRowSelection] = React.useState({}); const [showFilter, setShowFilter] = useState(false); const table = useReactTable({ data: mockData, columns, state: { pagination, rowSelection, }, enableRowSelection: true, onRowSelectionChange: setRowSelection, getCoreRowModel: getCoreRowModel(), getPaginationRowModel: getPaginationRowModel(), onPaginationChange: setPagination, pageCount: Math.ceil(mockData.length / pagination.pageSize), manualPagination: false, }); return (
{/* Header */}

Data Akun

{/* Account Table Section */}
{/* Search and Filter */}
{showFilter && (
setShowFilter(false)} />
)}
{/* Table */}
); }; export default Components;