diff --git a/apps/remix/app/components/tables/documents-table-action-dropdown.tsx b/apps/remix/app/components/tables/documents-table-action-dropdown.tsx index ea0f11fc1..a914203b6 100644 --- a/apps/remix/app/components/tables/documents-table-action-dropdown.tsx +++ b/apps/remix/app/components/tables/documents-table-action-dropdown.tsx @@ -48,9 +48,13 @@ export type DocumentsTableActionDropdownProps = { recipients: Recipient[]; team: Pick | null; }; + onMoveDocument?: () => void; }; -export const DocumentsTableActionDropdown = ({ row }: DocumentsTableActionDropdownProps) => { +export const DocumentsTableActionDropdown = ({ + row, + onMoveDocument, +}: DocumentsTableActionDropdownProps) => { const { user } = useSession(); const team = useOptionalCurrentTeam(); @@ -165,6 +169,13 @@ export const DocumentsTableActionDropdown = ({ row }: DocumentsTableActionDropdo )} + {onMoveDocument && ( + e.preventDefault()}> + + Move to Folder + + )} + {/* No point displaying this if there's no functionality. */} {/* diff --git a/apps/remix/app/components/tables/documents-table.tsx b/apps/remix/app/components/tables/documents-table.tsx index 4f6dc0050..fe1187b74 100644 --- a/apps/remix/app/components/tables/documents-table.tsx +++ b/apps/remix/app/components/tables/documents-table.tsx @@ -29,11 +29,17 @@ export type DocumentsTableProps = { data?: TFindDocumentsResponse; isLoading?: boolean; isLoadingError?: boolean; + onMoveDocument?: (documentId: number) => void; }; type DocumentsTableRow = TFindDocumentsResponse['data'][number]; -export const DocumentsTable = ({ data, isLoading, isLoadingError }: DocumentsTableProps) => { +export const DocumentsTable = ({ + data, + isLoading, + isLoadingError, + onMoveDocument, +}: DocumentsTableProps) => { const { _, i18n } = useLingui(); const team = useOptionalCurrentTeam(); @@ -80,12 +86,15 @@ export const DocumentsTable = ({ data, isLoading, isLoadingError }: DocumentsTab (!row.original.deletedAt || isDocumentCompleted(row.original.status)) && (
- + onMoveDocument(row.original.id) : undefined} + />
), }, ] satisfies DataTableColumnDef[]; - }, [team]); + }, [team, onMoveDocument, _, i18n]); const onPaginationChange = (page: number, perPage: number) => { startTransition(() => {