Skip to content

Commit bd0311e

Browse files
BillLeoutsakosvl346Bill Leoutsakos
andauthored
improvement(ui): reuse shared product status pages (#8089)
* improvement(ui): reuse shared product status pages * fix(ui): preserve the existing chat recovery button --------- Co-authored-by: Bill Leoutsakos <billleoutsakos@Mac.localdomain>
1 parent 5457698 commit bd0311e

3 files changed

Lines changed: 16 additions & 20 deletions

File tree

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { Button } from '@sim/emcn'
3+
import { Button, StatusPageContent } from '@sim/emcn'
44
import { useRouter } from 'next/navigation'
55
import { APP_ENTRY_PATH } from '@/lib/navigation/paths'
66

@@ -13,19 +13,16 @@ export function ChatErrorState({ error }: ChatErrorStateProps) {
1313

1414
return (
1515
<div className='flex flex-1 items-center justify-center px-4 py-16 text-center'>
16-
<div className='flex w-full max-w-[410px] flex-col items-center gap-3'>
17-
<h1 className='text-balance text-[40px] text-[var(--text-primary)] leading-[110%] tracking-[-0.02em]'>
18-
Chat Unavailable
19-
</h1>
20-
<p className='text-[var(--text-muted)] text-lg'>{error}</p>
16+
<StatusPageContent title='Chat Unavailable' description={error}>
2117
<Button
18+
type='button'
2219
variant='primary'
23-
onClick={() => router.push(APP_ENTRY_PATH)}
2420
className='h-[32px] w-full gap-2 px-2.5 text-sm'
21+
onClick={() => router.push(APP_ENTRY_PATH)}
2522
>
2623
Open Sim
2724
</Button>
28-
</div>
25+
</StatusPageContent>
2926
</div>
3027
)
3128
}

‎apps/sim/app/oauth/credential-connected/page.tsx‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChipLink } from '@sim/emcn'
1+
import { ChipLink, StatusPageContent } from '@sim/emcn'
22
import type { Metadata } from 'next'
33
import { APP_ENTRY_PATH } from '@/lib/navigation/paths'
44
import { LogoShell } from '@/app/(landing)/components/logo-shell'
@@ -22,19 +22,18 @@ export default async function CredentialConnectedPage({
2222

2323
return (
2424
<LogoShell center>
25-
<div className='flex w-full max-w-[410px] flex-col items-center gap-3 text-center'>
26-
<h1 className='text-balance text-[40px] text-[var(--text-primary)] leading-[110%] tracking-[-0.02em]'>
27-
{connected ? 'Credential connected' : 'Connection failed'}
28-
</h1>
29-
<p className='text-pretty text-[var(--text-muted)] text-lg'>
30-
{connected
25+
<StatusPageContent
26+
title={connected ? 'Credential connected' : 'Connection failed'}
27+
description={
28+
connected
3129
? 'The credential is ready to use. You can close this tab and return to the app that started the connection.'
32-
: 'The credential could not be connected. Return to the app that started the connection and try again.'}
33-
</p>
34-
<ChipLink variant='primary' href={APP_ENTRY_PATH} className='mt-3'>
30+
: 'The credential could not be connected. Return to the app that started the connection and try again.'
31+
}
32+
>
33+
<ChipLink variant='primary' href={APP_ENTRY_PATH}>
3534
Open Sim
3635
</ChipLink>
37-
</div>
36+
</StatusPageContent>
3837
</LogoShell>
3938
)
4039
}

‎packages/emcn/src/components/status-page/status-page.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function StatusPageContent({
2929
{title}
3030
</h1>
3131
<p className='text-[var(--text-body)] text-lg'>{description}</p>
32-
<div className='mt-3 flex flex-wrap items-center justify-center gap-2'>{children}</div>
32+
<div className='mt-3 flex w-full flex-wrap items-center justify-center gap-2'>{children}</div>
3333
{detail}
3434
</div>
3535
)

0 commit comments

Comments
 (0)