import { useLocation, useParams } from "react-router-dom";
import LetterViewer from "../common/letterViewer";
import { CollaborationDto } from "@/record-management/services/api/collaborationService";

const ViewCollaborationRecord = () => {
  const location = useLocation();
  const collaboration = (
    location.state as { collaboration?: CollaborationDto } | null
  )?.collaboration;

  return (
    <LetterViewer
      backurl="/record-management/collaborations"
      type="collaboration"
      shouldFetchInstance={false}
      actionRowData={collaboration}
      actions="CollaborationActionsComponent"
    />
  );
};

export default ViewCollaborationRecord;
