import dayjs from 'dayjs'; import { ChevronLeft } from 'lucide-react'; import { useRef } from 'react'; import { Button, ContentTooltip, Skeleton, TextWithNAFallback } from '@ballerine/ui'; import { Separator } from '@/common/components/atoms/Separator/Separator'; import { SectionObserver } from '@/common/components/organisms/SectionObserver/SectionObserver'; import { useKybAndOwnershipAssessmentPageLogic } from './hooks/useKybAndOwnershipAssessmentPageLogic'; import { NotesSheet } from '@/domains/notes/NotesSheet'; import { NotesButton } from '@/domains/notes/NotesButton'; import { MerchantMonitoringReportStatus } from '../MerchantMonitoring/components/MerchantMonitoringReportStatus/MerchantMonitoringReportStatus'; export const KybAndOwnershipAssessmentPage = () => { const { sections, assessment, isLoadingAssessment, assessmentId, onNavigateBack, notes, isNotesOpen, setIsNotesOpen, } = useKybAndOwnershipAssessmentPageLogic(); const sectionRefs = useRef<{ [key: string]: HTMLDivElement | null }>({}); if (isLoadingAssessment || !assessment) { return ( <>
); } return (
{assessment.input?.companyName}
Status
Created at {assessment.createdAt && dayjs(new Date(assessment.createdAt)).format('MMM Do, YYYY HH:mm')}
{sections.map(section => { const titleContent = (
{section.Icon && } {section.title}
); return (
(sectionRefs.current[section.id] = el)} className="min-h-[100px]" // Minimum height helps with detection > {section.description ? ( {titleContent} ) : ( <>{titleContent} )} {section.Component}
); })}
); };