diff --git a/admin/inertia/components/TierSelectionModal.tsx b/admin/inertia/components/TierSelectionModal.tsx index f135f3c..3db5094 100644 --- a/admin/inertia/components/TierSelectionModal.tsx +++ b/admin/inertia/components/TierSelectionModal.tsx @@ -74,7 +74,7 @@ const TierSelectionModal: React.FC = ({ [selectedTierResources] ) - const { data: embedEstimate } = useQuery({ + const { data: embedEstimate, isLoading: isEstimating } = useQuery({ queryKey: ['embedEstimateBatch', embedEstimateRequest], queryFn: () => api.estimateEmbeddingBatch(embedEstimateRequest), enabled: embedEstimateRequest.length > 0, @@ -158,6 +158,7 @@ const TierSelectionModal: React.FC = ({ } return ( + <> = ({ variant='primary' size='lg' onClick={handleSubmit} - disabled={!localSelectedSlug} + disabled={!localSelectedSlug || (embedEstimateRequest.length > 0 && isEstimating)} > Submit @@ -355,18 +356,19 @@ const TierSelectionModal: React.FC = ({ - {guardrailVerdict && ( - { - setGuardrailVerdict(null) - finalizeSubmit() - }} - onCancel={() => setGuardrailVerdict(null)} - /> - )} + {guardrailVerdict && ( + { + setGuardrailVerdict(null) + finalizeSubmit() + }} + onCancel={() => setGuardrailVerdict(null)} + /> + )} + ) }