MCPcopy Create free account
hub / github.com/vercel/examples / DeployButton

Function DeployButton

internal/packages/ui/src/deploy-button.tsx:13–41  ·  view source on GitHub ↗
(props: DeployButtonProps)

Source from the content-addressed store, hash-verified

11}
12
13export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected