(props: DeployButtonProps)
| 11 | } |
| 12 | |
| 13 | export const DeployButton = (props: DeployButtonProps) => { |
| 14 | const params = [ |
| 15 | ['repository-url', props.repositoryUrl], |
| 16 | ['env', props.env?.join(',')], |
| 17 | ['project-name', props.projectName], |
| 18 | ['repository-name', props.repositoryName], |
| 19 | ] |
| 20 | const query = params |
| 21 | .reduce<string[]>((arr, [k, v]) => { |
| 22 | if (v) arr.push(`${k}=${encodeURIComponent(v)}`) |
| 23 | return arr |
| 24 | }, []) |
| 25 | .join('&') |
| 26 | |
| 27 | return ( |
| 28 | <Button |
| 29 | Component="a" |
| 30 | href={ |
| 31 | props.customDeployUrl |
| 32 | ? props.customDeployUrl |
| 33 | : `${VERCEL_CLONE}${query ? `?${query}` : ''}` |
| 34 | } |
| 35 | target="_blank" |
| 36 | rel="noreferrer" |
| 37 | > |
| 38 | Clone & Deploy |
| 39 | </Button> |
| 40 | ) |
| 41 | } |
nothing calls this directly
no outgoing calls
no test coverage detected