ProvisionerForm.tsx 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import React from "react";
  2. import styled from "styled-components";
  3. import aws from "assets/aws.png";
  4. import azure from "assets/azure.png";
  5. import gcp from "assets/gcp.png";
  6. import AzureProvisionerSettings from "./AzureProvisionerSettings";
  7. import GCPProvisionerSettings from "./GCPProvisionerSettings";
  8. import Container from "./porter/Container";
  9. import Spacer from "./porter/Spacer";
  10. import Text from "./porter/Text";
  11. import ProvisionerSettings from "./ProvisionerSettings";
  12. type Props = {
  13. goBack: () => void;
  14. credentialId: string;
  15. provider: string;
  16. };
  17. const ProvisionerForm: React.FC<Props> = ({
  18. goBack,
  19. credentialId,
  20. provider,
  21. }) => {
  22. return (
  23. <>
  24. {provider === "aws" && (
  25. <>
  26. <Container row>
  27. <BackButton width="155px" onClick={goBack}>
  28. <i className="material-icons">first_page</i>
  29. Set credentials
  30. </BackButton>
  31. <Spacer inline width="17px" />
  32. <Img src={aws} />
  33. <Text size={16}>Configure settings</Text>
  34. </Container>
  35. <Spacer y={1} />
  36. <ProvisionerSettings credentialId={credentialId} />
  37. </>
  38. )}
  39. {provider === "azure" && (
  40. <>
  41. <Container row>
  42. <BackButton width="155px" onClick={goBack}>
  43. <i className="material-icons">first_page</i>
  44. Set credentials
  45. </BackButton>
  46. <Spacer inline width="17px" />
  47. <Img src={azure} />
  48. <Text size={16}>Configure settings</Text>
  49. </Container>
  50. <Spacer y={1} />
  51. <AzureProvisionerSettings credentialId={credentialId} />
  52. </>
  53. )}
  54. {provider === "gcp" && (
  55. <>
  56. <Container row>
  57. <BackButton width="155px" onClick={goBack}>
  58. <i className="material-icons">first_page</i>
  59. Set credentials
  60. </BackButton>
  61. <Spacer inline width="17px" />
  62. <Img src={gcp} />
  63. <Text size={16}>Configure settings</Text>
  64. </Container>
  65. <Spacer y={1} />
  66. <Text color="helper">
  67. Configure settings for your GCP environment.
  68. </Text>
  69. <Spacer y={1} />
  70. <GCPProvisionerSettings credentialId={credentialId} />
  71. </>
  72. )}
  73. </>
  74. );
  75. };
  76. export default ProvisionerForm;
  77. const Img = styled.img`
  78. height: 18px;
  79. margin-right: 15px;
  80. `;
  81. const BackButton = styled.div`
  82. display: flex;
  83. align-items: center;
  84. justify-content: space-between;
  85. cursor: pointer;
  86. font-size: 13px;
  87. height: 35px;
  88. padding: 5px 13px;
  89. padding-right: 15px;
  90. border: 1px solid #ffffff55;
  91. border-radius: 100px;
  92. width: ${(props: { width: string }) => props.width};
  93. color: white;
  94. background: #ffffff11;
  95. :hover {
  96. background: #ffffff22;
  97. }
  98. > i {
  99. color: white;
  100. font-size: 16px;
  101. margin-right: 6px;
  102. margin-left: -2px;
  103. }
  104. `;