Cursor Prompt for KYC Error Modal
I want you to do the following in my Dashboard page:
1. When the user visits `/dashboard`, make a GET request to:
http://localhost:3000/stripe/check-kyc/:id
The `:id` should be dynamically taken from `localStorage.getItem("stripeAccountId")`.
2. If the API response contains:
{
"status": "requires_resubmission",
"errors": [ ... ]
}
Then show a **modal** at the top center of the screen.
3. The modal should:
- Have a close button (×) on the top-left.
- Show the first error’s `reason` from `response.data.errors[0].reason`.
- Have a button labeled `Resubmit Documents`.
4. When the button is clicked, redirect the user to:
/resubmit-kyc
5. Use Tailwind CSS for modal styles:
- Fixed at top center
- White background, rounded corners, shadow, padding
- Modal width: around 350–400px
- z-index should be high enough (z-50)
- Show only once on page load
6. Don’t use any third-party modal library. Use React hooks like `useState` and `useEffect`.
7. Ignore resubmit-kyc page implementation for now.