The small client preview card must update when profileId changes, correctly cancel stale loads, and close on Esc only while it is open.
PreviewCard component receives props:
profileId: stringopen: booleanprofileId changes, it is necessary to:
api.fetchProfile(profileId) request;profileId is empty or consists only of spaces, the card must be cleared and no request should be made.Escape must call emit('close').keydown handler must be removed.profileId = "alfa" and wait for the API response.profileId to beta while the first request is still in flight.Escape when open = true, then close the card and press Escape again outside the card.profileId = " ".profileId, the card should show data only for the current profile.profileId is empty or whitespace-only, the card must be cleared.Escape should work only while the card is open and must not remain active after closing.api.fetchProfile(id: string): Promise<{ id: string; name: string; city: string }>pnpm test runs browser component testsUse line comments to explain the problem, its impact, the fix and how to test it.