@@ -5,22 +5,22 @@ import { useNavigate, useSearchParams } from 'react-router-dom';
55import cn from 'classnames' ;
66import * as yup from 'yup' ;
77import { Box , Link , WizardProps } from '@cloudscape-design/components' ;
8- import { ButtonProps } from '@cloudscape-design/components/button' ;
98import { CardsProps } from '@cloudscape-design/components/cards' ;
109
11- import { Alert , Button , TabsProps , ToggleProps } from 'components' ;
10+ import { TabsProps , ToggleProps } from 'components' ;
1211import { Container , FormCodeEditor , FormField , FormInput , FormSelect , SpaceBetween , Tabs , Toggle , Wizard } from 'components' ;
1312
1413import { useBreadcrumbs , useNotifications } from 'hooks' ;
15- import { getServerError , goToUrl } from 'libs' ;
14+ import { useCheckingForFleetsInProjects } from 'hooks/useCheckingForFleetsInProjectsOfMember' ;
15+ import { getServerError } from 'libs' ;
1616import { ROUTES } from 'routes' ;
1717import { useApplyRunMutation } from 'services/run' ;
1818
1919import { OfferList } from 'pages/Offers/List' ;
20+ import { NoFleetProjectAlert } from 'pages/Project/components/NoFleetProjectAlert' ;
2021
2122import { useGenerateYaml } from './hooks/useGenerateYaml' ;
2223import { useGetRunSpecFromYaml } from './hooks/useGetRunSpecFromYaml' ;
23- import { useCheckingForFleetsInProjects } from '../../../hooks/useCheckingForFleetsInProjectsOfMember' ;
2424import { FORM_FIELD_NAMES } from './constants' ;
2525
2626import { IRunEnvironmentFormKeys , IRunEnvironmentFormValues } from './types' ;
@@ -284,28 +284,13 @@ export const CreateDevEnvironment: React.FC = () => {
284284 setValue ( 'config_yaml' , yaml ) ;
285285 } , [ yaml ] ) ;
286286
287- const onCreateAFleet : ButtonProps [ 'onClick' ] = ( event ) => {
288- event . preventDefault ( ) ;
289- goToUrl ( 'https://dstack.ai/docs/quickstart/#create-a-fleet' , true ) ;
290- } ;
291-
292287 return (
293288 < form className = { cn ( { [ styles . wizardForm ] : activeStepIndex === 0 } ) } onSubmit = { handleSubmit ( onSubmit ) } >
294- { projectDontHasFleets && (
295- < div className = { styles . alertBox } >
296- < Alert
297- header = { t ( 'fleets.no_alert.title' ) }
298- type = "info"
299- action = {
300- < Button iconName = "external" formAction = "none" onClick = { onCreateAFleet } >
301- { t ( 'fleets.no_alert.button_title' ) }
302- </ Button >
303- }
304- >
305- The project < code > { selectedProject } </ code > has no fleets. Create one before submitting a run.
306- </ Alert >
307- </ div >
308- ) }
289+ < NoFleetProjectAlert
290+ className = { styles . noFleetAlert }
291+ projectName = { selectedProject ?? '' }
292+ show = { projectDontHasFleets }
293+ />
309294
310295 < Wizard
311296 activeStepIndex = { activeStepIndex }
0 commit comments