11import { useEffect , useState , useMemo } from 'react' ;
22import { useParams , useNavigate } from 'react-router-dom' ;
3- import { ArrowRight , CheckCircle2 } from 'lucide-react' ;
3+ import { CheckCircle2 } from 'lucide-react' ;
44import { reactClient as vincentApiClient } from '@lit-protocol/vincent-registry-sdk' ;
55
66import { AppVersionAbility , Ability } from '@/types/developer-dashboard/appTypes' ;
77import { ManageAppVersionAbilities } from '../views/ManageAppVersionAbilities.tsx' ;
88import { CreateAppVersionAbilitiesForm } from '../forms/CreateAppVersionAbilitiesForm.tsx' ;
9+ import { PublishAppVersionWrapper } from './PublishAppVersionWrapper' ;
910import Loading from '@/components/shared/ui/Loading' ;
1011import { StatusMessage } from '@/components/shared/ui/statusMessage' ;
11- import { Button } from '@/components/shared/ui/button' ;
1212import { Breadcrumb } from '@/components/shared/ui/Breadcrumb' ;
1313import { theme , fonts } from '@/components/user-dashboard/connect/ui/theme' ;
14+ import { useBlockchainAppData } from '@/hooks/useBlockchainAppData' ;
1415
1516export function AppVersionAbilitiesWrapper ( ) {
1617 const { appId, versionId } = useParams < { appId : string ; versionId : string } > ( ) ;
@@ -24,6 +25,8 @@ export function AppVersionAbilitiesWrapper() {
2425 isError : appError ,
2526 } = vincentApiClient . useGetAppQuery ( { appId : Number ( appId ) } ) ;
2627
28+ const { blockchainAppData, blockchainAppLoading } = useBlockchainAppData ( Number ( appId ) ) ;
29+
2730 const {
2831 data : versionData ,
2932 isLoading : versionLoading ,
@@ -74,7 +77,13 @@ export function AppVersionAbilitiesWrapper() {
7477 } , [ isSuccess , data ] ) ;
7578
7679 // Show loading while data is loading OR while checking authorization
77- if ( appLoading || versionLoading || versionAbilitiesLoading || abilitiesLoading )
80+ if (
81+ appLoading ||
82+ versionLoading ||
83+ versionAbilitiesLoading ||
84+ abilitiesLoading ||
85+ blockchainAppLoading
86+ )
7887 return < Loading /> ;
7988
8089 // Handle errors
@@ -157,36 +166,23 @@ export function AppVersionAbilitiesWrapper() {
157166 className = { `${ theme . mainCard } border rounded-xl p-6` }
158167 style = { { borderColor : theme . brandOrange } }
159168 >
160- < div className = "flex flex-col sm:flex-row items-start sm:items-center justify-between gap -4" >
169+ < div className = "space-y -4" >
161170 < div className = "flex items-start gap-3" >
162171 < CheckCircle2
163172 className = "h-5 w-5 flex-shrink-0 mt-0.5"
164173 style = { { color : theme . brandOrange } }
165174 />
166- < div >
175+ < div className = "flex-1" >
167176 < h3 className = { `font-semibold ${ theme . text } ` } style = { fonts . heading } >
168- Ready to Publish?
177+ Ready to Publish
169178 </ h3 >
170179 < p className = { `text-sm ${ theme . textMuted } mt-1` } style = { fonts . body } >
171180 Your app version has { activeAbilities . length } abilit
172- { activeAbilities . length === 1 ? 'y' : 'ies' } configured.
181+ { activeAbilities . length === 1 ? 'y' : 'ies' } configured and is ready to publish .
173182 </ p >
174183 </ div >
175184 </ div >
176- < Button
177- onClick = { ( ) => navigate ( `/developer/apps/appId/${ appId } /version/${ versionId } ` ) }
178- className = "w-full sm:w-auto text-white"
179- style = { { backgroundColor : theme . brandOrange } }
180- onMouseEnter = { ( e ) => {
181- e . currentTarget . style . backgroundColor = theme . brandOrangeDarker ;
182- } }
183- onMouseLeave = { ( e ) => {
184- e . currentTarget . style . backgroundColor = theme . brandOrange ;
185- } }
186- >
187- Publish App Version
188- < ArrowRight className = "h-4 w-4 ml-2" />
189- </ Button >
185+ < PublishAppVersionWrapper isAppPublished = { blockchainAppData !== null } />
190186 </ div >
191187 </ div >
192188 ) }
0 commit comments