diff --git a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/evaluations/[evaluationId]/_components/Actions/index.tsx b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/evaluations/[evaluationId]/_components/Actions/index.tsx index 13ef38a46..8a00d57fa 100644 --- a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/evaluations/[evaluationId]/_components/Actions/index.tsx +++ b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/evaluations/[evaluationId]/_components/Actions/index.tsx @@ -1,9 +1,8 @@ 'use client' -import { useCallback, useState } from 'react' - import { EvaluationDto } from '@latitude-data/core/browser' import { TableWithHeader, useCurrentDocument } from '@latitude-data/web-ui' +import { useToggleModal } from '$/hooks/useToogleModal' import CreateBatchEvaluationModal from './CreateBatchEvaluationModal' import LiveEvaluationToggle from './LiveEvaluationToggle' @@ -20,9 +19,7 @@ export function Actions({ documentUuid: string }) { const document = useCurrentDocument() - const [open, setOpen] = useState(false) - const onClose = useCallback(() => setOpen(false), []) - const onOpen = useCallback(() => setOpen(true), []) + const { open, onClose, onOpen } = useToggleModal() return (