import React from 'react'; import Link from 'next/link'; import CardBox from '../CardBox'; import dataFormatter from '../../helpers/dataFormatter'; import ListActionsPopover from "../ListActionsPopover"; import { useAppSelector } from "../../stores/hooks"; import { Pagination } from "../Pagination"; import LoadingSpinner from "../LoadingSpinner"; import { hasPermission } from "../../helpers/userPermissions"; type Props = { checklist_items: any[]; loading: boolean; onDelete: (id: string) => void; currentPage: number; numPages: number; onPageChange: (page: number) => void; }; const formatChecklist = (checklist: any) => { const value = dataFormatter.human_review_checklistsOneListFormatter(checklist); if (!value) { return 'Checklist not linked'; } return value; }; const ListChecklist_items = ({ checklist_items, loading, onDelete, currentPage, numPages, onPageChange }: Props) => { const currentUser = useAppSelector((state) => state.auth.currentUser); const hasUpdatePermission = hasPermission(currentUser, 'UPDATE_CHECKLIST_ITEMS'); return ( <>
{loading && (
)} {!loading && checklist_items.map((item) => (
#{item.item_order || '-'}

Review item

{item.item_text || 'Untitled review item'}
Order {item.item_order || 'not set'} {item.is_required ? 'Required' : 'Optional'}

Linked checklist

{formatChecklist(item.checklist)}

This step becomes part of the human oversight record before AI-assisted work is relied on or sent outside the legal team.

))} {!loading && checklist_items.length === 0 && (

No checklist items to display

)}
) }; export default ListChecklist_items