ruvector/studio/components/interfaces/OrganizationInvite/OrganizationInviteError.tsx
rUv 814f595995 feat(studio): Add complete RuVector Studio application
Major additions:
- Complete Next.js studio application with 1600+ components
- Docker support (Dockerfile.combined, docker-compose.yml)
- GCP deployment documentation and benchmarks
- SQL benchmark scripts for performance testing
- Sentry integration for monitoring
- Comprehensive test suite and mocks

Studio features:
- Dashboard and admin interfaces
- Data visualization components
- Authentication and user management
- API integration with RuVector backend
- Static data and public assets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 23:04:48 +00:00

68 lines
2.3 KiB
TypeScript

import { useRouter } from 'next/router'
import AlertError from 'components/ui/AlertError'
import { OrganizationInviteByToken } from 'data/organization-members/organization-invitation-token-query'
import { useSignOut } from 'lib/auth'
import { useProfile } from 'lib/profile'
import type { ResponseError } from 'types'
import { cn } from 'ui'
interface OrganizationInviteError {
data?: OrganizationInviteByToken
error?: ResponseError | null
isError: boolean
}
export const OrganizationInviteError = ({ data, error, isError }: OrganizationInviteError) => {
const router = useRouter()
const signOut = useSignOut()
const { profile } = useProfile()
return (
<div className={cn('flex flex-col items-center justify-center gap-y-1 text-sm')}>
{isError ? (
<AlertError
error={error}
subject="Failed to retrieve token"
className="border-0 rounded-b [&>h5]:text-left [&>div]:items-start rounded-t-none"
/>
) : !data?.email_match ? (
<div className="p-4 flex flex-col gap-y-1">
<p>
Your email address {profile?.primary_email} does not match the email address this
invitation was sent to.
</p>
<p className="text-foreground-lighter">
To accept this invitation, you will need to{' '}
<a
className="cursor-pointer text-brand"
onClick={async () => {
await signOut()
router.reload()
}}
>
sign out
</a>{' '}
and then sign in or create a new account using the same email address used in the
invitation.
</p>
</div>
) : data.expired_token ? (
<div className="p-4 flex flex-col gap-y-1">
<p>The invite token has expired.</p>
<p className="text-foreground-lighter">
Please request a new one from the organization owner.
</p>
</div>
) : (
<div className="p-4 flex flex-col gap-y-1">
<p>The invite token is invalid.</p>
<p className="text-foreground-lighter">
You could be logged in with the wrong account. Try copying and pasting the link from the
invite email, or ask the organization owner to invite you again.
</p>
</div>
)}
</div>
)
}