@@ -10,6 +10,10 @@ import { Link } from 'react-router-dom'
1010
1111import { Error12Icon , PrevArrow12Icon } from '@oxide/design-system/icons/react'
1212
13+ import { useApiMutation } from '~/api/client'
14+ import { navToLogin } from '~/api/nav-to-login'
15+ import { Button } from '~/ui/lib/Button'
16+
1317const GradientBackground = ( ) => (
1418 < div
1519 // negative z-index avoids covering MSW warning banner
@@ -27,14 +31,15 @@ export function ErrorPage({ children }: Props) {
2731 return (
2832 < div className = "flex w-full justify-center" >
2933 < GradientBackground />
30- < div className = "relative w-full" >
34+ < div className = "relative flex w-full justify-between " >
3135 < Link
3236 to = "/"
3337 className = "flex items-center p-6 text-mono-sm text-secondary hover:text-default"
3438 >
3539 < PrevArrow12Icon title = "Select" className = "mr-2 text-tertiary" />
3640 Back to console
3741 </ Link >
42+ < SignOutButton className = "mr-6 mt-4" />
3843 </ div >
3944 < div className = "absolute left-1/2 top-1/2 flex w-96 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center space-y-4 rounded-lg border p-8 !bg-raise border-secondary elevation-3" >
4045 < div className = "my-2 flex h-12 w-12 items-center justify-center" >
@@ -58,3 +63,19 @@ export function NotFound() {
5863 </ ErrorPage >
5964 )
6065}
66+
67+ export function SignOutButton ( { className } : { className ?: string } ) {
68+ const logout = useApiMutation ( 'logout' , {
69+ onSuccess : ( ) => navToLogin ( { includeCurrent : false } ) ,
70+ } )
71+ return (
72+ < Button
73+ onClick = { ( ) => logout . mutate ( { } ) }
74+ className = { className }
75+ size = "sm"
76+ variant = "ghost"
77+ >
78+ Sign out
79+ </ Button >
80+ )
81+ }
0 commit comments