diff --git a/apps/portal/src/app/features/seafarer/pages/MySeaRecordsPage.tsx b/apps/portal/src/app/features/seafarer/pages/MySeaRecordsPage.tsx
index ee98ca11e..f3fd064ca 100644
--- a/apps/portal/src/app/features/seafarer/pages/MySeaRecordsPage.tsx
+++ b/apps/portal/src/app/features/seafarer/pages/MySeaRecordsPage.tsx
@@ -4,6 +4,7 @@ import {
Anchor,
Badge,
Button,
+ Card,
FileButton,
Group,
Loader,
@@ -12,7 +13,6 @@ import {
Paper,
Select,
Stack,
- Table,
Tabs,
Text,
TextInput,
@@ -31,7 +31,7 @@ import {
IconTrash,
} from '@tabler/icons-react';
import { useState } from 'react';
-import { notify } from '@ema-platform/ui';
+import { AdvancedTable, notify, useServerTable, type AdvancedColumn } from '@ema-platform/ui';
import {
extractErrorMessage,
uploadDocument,
@@ -237,7 +237,82 @@ function SeaServiceTab() {
form.dischargeDate &&
form.engagementDate < form.dischargeDate;
- if (isLoading) return ;
+ const { setPageIndex, pageSize, paginate } = useServerTable({ pageSize: 10 });
+ const page = paginate(records ?? []);
+
+ const columns: AdvancedColumn[] = [
+ {
+ header: 'Vessel',
+ cell: ({ row }) => (
+ <>
+
+ {row.original.vesselName}
+
+ {row.original.imoNumber && (
+
+ IMO {row.original.imoNumber}
+
+ )}
+ >
+ ),
+ },
+ { header: 'Rank', accessorKey: 'rank' },
+ { header: 'From', accessorKey: 'engagementDate' },
+ { header: 'To', accessorKey: 'dischargeDate' },
+ {
+ header: 'Status',
+ cell: ({ row }) => (
+
+
+ {row.original.status}
+
+
+ ),
+ },
+ {
+ header: '',
+ label: 'Actions',
+ align: 'right',
+ cell: ({ row }) => {
+ const record = row.original;
+ const locked = record.status !== 'SUBMITTED';
+ return (
+
+
+ setEvidenceFor(record.id)}
+ >
+
+
+
+
+ openEdit(record)}
+ >
+
+
+
+
+ remove(record)}
+ >
+
+
+
+
+ );
+ },
+ },
+ ];
return (
@@ -264,87 +339,18 @@ function SeaServiceTab() {
) : (
-
-
-
-
- Vessel
- Rank
- From
- To
- Status
-
-
-
-
- {(records ?? []).map((record) => {
- const locked = record.status !== 'SUBMITTED';
- return (
-
-
-
- {record.vesselName}
-
- {record.imoNumber && (
-
- IMO {record.imoNumber}
-
- )}
-
- {record.rank}
- {record.engagementDate}
- {record.dischargeDate}
-
-
-
- {record.status}
-
-
-
-
-
-
- setEvidenceFor(record.id)}
- >
-
-
-
-
- openEdit(record)}
- >
-
-
-
-
- remove(record)}
- >
-
-
-
-
-
-
- );
- })}
-
-
-
+
+
+
)}
;
+ const { setPageIndex, pageSize, paginate } = useServerTable({ pageSize: 10 });
+ const page = paginate(certificates ?? []);
+
+ const columns: AdvancedColumn[] = [
+ {
+ header: 'Issuer',
+ cell: ({ row }) => (
+ <>
+
+ {row.original.issuerName}
+
+ {row.original.certificateNumber && (
+
+ № {row.original.certificateNumber}
+
+ )}
+ >
+ ),
+ },
+ { header: 'Issued', accessorKey: 'issueDate' },
+ {
+ header: 'Expires',
+ cell: ({ row }) => (
+
+ {row.original.expiryDate}
+ {row.original.expiryDate < today && Expired}
+
+ ),
+ },
+ {
+ header: 'Fitness',
+ cell: ({ row }) =>
+ FITNESS_OPTIONS.find((o) => o.value === row.original.fitnessStatus)
+ ?.label ?? row.original.fitnessStatus,
+ },
+ {
+ header: 'Status',
+ cell: ({ row }) => (
+
+
+ {row.original.status}
+
+
+ ),
+ },
+ {
+ header: '',
+ label: 'Actions',
+ align: 'right',
+ cell: ({ row }) => {
+ const certificate = row.original;
+ const locked = certificate.status !== 'SUBMITTED';
+ return (
+
+
+ setEvidenceFor(certificate.id)}
+ >
+
+
+
+
+ openEdit(certificate)}
+ >
+
+
+
+
+ remove(certificate)}
+ >
+
+
+
+
+ );
+ },
+ },
+ ];
return (
@@ -550,103 +644,18 @@ function MedicalTab() {
) : (
-
-
-
-
- Issuer
- Issued
- Expires
- Fitness
- Status
-
-
-
-
- {(certificates ?? []).map((certificate) => {
- const locked = certificate.status !== 'SUBMITTED';
- const expired = certificate.expiryDate < today;
- return (
-
-
-
- {certificate.issuerName}
-
- {certificate.certificateNumber && (
-
- № {certificate.certificateNumber}
-
- )}
-
- {certificate.issueDate}
-
-
- {certificate.expiryDate}
- {expired && Expired}
-
-
-
- {FITNESS_OPTIONS.find(
- (o) => o.value === certificate.fitnessStatus,
- )?.label ?? certificate.fitnessStatus}
-
-
-
-
- {certificate.status}
-
-
-
-
-
-
- setEvidenceFor(certificate.id)}
- >
-
-
-
-
- openEdit(certificate)}
- >
-
-
-
-
- remove(certificate)}
- >
-
-
-
-
-
-
- );
- })}
-
-
-
+
+
+
)}