import { useState } from 'react' import { Button } from 'ui' import { IntrospectionConfirmModal } from './IntrospectionConfirmModal' import { useSetIntrospection } from './useSetIntrospection' interface IntrospectionEnabledNoticeProps { schema: string currentSchemaComment: string | null | undefined onDisabled: () => void } export const IntrospectionEnabledNotice = ({ schema, currentSchemaComment, onDisabled, }: IntrospectionEnabledNoticeProps) => { const [showConfirm, setShowConfirm] = useState(false) const { apply, isPending, sql, existingDirectiveIsMalformed, otherExistingKeys } = useSetIntrospection({ schema, currentSchemaComment, enabled: false, onMutationSuccess: () => setShowConfirm(false), onInvalidated: onDisabled, }) return ( <>