Show messages or redirect based on ratings
Trigger actions as soon as the user rates:
1const { review } = useProofConvert();
2
3const handleCheckout = () => {
4 review('checkout-flow', {
5 onRate: (data) => {
6 // 5 stars? 🎉
7 if (data.rating >= 5) confetti();
8
9 // 1-2 stars? 💬
10 if (data.rating <= 2) openSupport();
11 },
12 onSubmit: () => {
13 router.push('/order-confirmed');
14 }
15 });
16};