mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-07 06:36:30 +00:00
refactor: update topup status handling in DynamicFilter and TopupsTable components ✨
This commit is contained in:
@ -122,7 +122,13 @@ export async function TopupsTable({
|
||||
|
||||
<TableCell>
|
||||
<span className="font-semibold pr-2">
|
||||
{topup.is_expired ? <Badge>Expired</Badge> : <Badge variant="outline">{topup.status}</Badge>}
|
||||
{topup.paid ? (
|
||||
<Badge className="bg-green-100 dark:bg-green-700" variant="outline">{topup.status}</Badge>
|
||||
) : topup.is_expired ? (
|
||||
<Badge className="text-black dark:text-white bg-yellow-100 dark:bg-yellow-700">Expired</Badge>
|
||||
) : (
|
||||
<Badge variant="outline">{topup.status}</Badge>
|
||||
)}
|
||||
</span>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
@ -150,10 +156,7 @@ export async function TopupsTable({
|
||||
</TableRow>
|
||||
</TableFooter>
|
||||
</Table>
|
||||
<Pagination
|
||||
totalPages={meta.total / meta.per_page}
|
||||
currentPage={meta.current_page}
|
||||
/>
|
||||
|
||||
</div>
|
||||
<div className="sm:hidden block">
|
||||
{data.map((topup) => (
|
||||
@ -161,8 +164,8 @@ export async function TopupsTable({
|
||||
))}
|
||||
</div>
|
||||
<Pagination
|
||||
totalPages={meta?.last_page}
|
||||
currentPage={meta?.current_page}
|
||||
totalPages={meta.total / meta.per_page}
|
||||
currentPage={meta.current_page}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user