Skip to content

Commit

Permalink
Merge branch 'feature/provider/pricing' into feature/provider/settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-arc10 committed Dec 2, 2024
2 parents ad06e23 + b26c45d commit da08635
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const providerPricingSchema = z.object({
type ProviderPricingValues = z.infer<typeof providerPricingSchema>;

export const ProviderPricing: React.FC<ProviderPricingProps> = ({ onComplete, editMode = false, existingPricing, disabled = false, providerDetails }) => {
console.log(existingPricing)
const [providerProcess, setProviderProcess] = useAtom(providerProcessStore.providerProcessAtom);
const { activeControlMachine } = useControlMachine();
const [showSuccess, setShowSuccess] = React.useState(false);
Expand Down Expand Up @@ -136,6 +137,12 @@ export const ProviderPricing: React.FC<ProviderPricingProps> = ({ onComplete, ed
}
});

useEffect(() => {
if (editMode && existingPricing) {
form.reset(existingPricing);
}
}, [editMode, existingPricing, form]);

const watchValues = form.watch();

const calculateEstimatedEarnings = useCallback(
Expand Down

0 comments on commit da08635

Please sign in to comment.