parent
4599614138
commit
9d7a5658c5
@ -0,0 +1,51 @@ |
|||||||
|
import React from 'react' |
||||||
|
import { FormattedMessage } from 'react-intl' |
||||||
|
|
||||||
|
export const createModalMessage = async ( |
||||||
|
defaultName: string, |
||||||
|
gitConfigNotSet: boolean, |
||||||
|
onChangeTemplateName: (name: string) => void, |
||||||
|
onChangeInitGit: (name: string) => void) => { |
||||||
|
|
||||||
|
return ( |
||||||
|
<> |
||||||
|
<label id="wsName" className="form-check-label" style={{ fontWeight: 'bolder' }}> |
||||||
|
<FormattedMessage id="filePanel.workspaceName" /> |
||||||
|
</label> |
||||||
|
<input |
||||||
|
type="text" |
||||||
|
data-id="modalDialogCustomPromptTextCreate" |
||||||
|
defaultValue={defaultName} |
||||||
|
className="form-control" |
||||||
|
onChange={(e) => onChangeTemplateName(e.target.value)} |
||||||
|
onInput={(e) => onChangeTemplateName((e.target as any).value)} |
||||||
|
/> |
||||||
|
<div className="d-flex py-2 align-items-center custom-control custom-checkbox"> |
||||||
|
<input |
||||||
|
id="initGitRepository" |
||||||
|
data-id="initGitRepository" |
||||||
|
className="form-check-input custom-control-input" |
||||||
|
type="checkbox" |
||||||
|
disabled={gitConfigNotSet} |
||||||
|
onChange={(e) => onChangeInitGit(e.target.value)} |
||||||
|
onInput={(e) => onChangeInitGit((e.target as any).value)} |
||||||
|
/> |
||||||
|
<label |
||||||
|
htmlFor="initGitRepository" |
||||||
|
data-id="initGitRepositoryLabel" |
||||||
|
className="m-0 form-check-label custom-control-label udapp_checkboxAlign" |
||||||
|
title={window._intl.formatMessage({ id: 'filePanel.initGitRepoTitle' })} |
||||||
|
> |
||||||
|
<FormattedMessage id="filePanel.initGitRepositoryLabel" /> |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
{gitConfigNotSet ? ( |
||||||
|
<div className="text-warning"> |
||||||
|
<FormattedMessage id="filePanel.initGitRepositoryWarning" /> |
||||||
|
</div> |
||||||
|
) : ( |
||||||
|
<></> |
||||||
|
)} |
||||||
|
</> |
||||||
|
) |
||||||
|
} |
Loading…
Reference in new issue