|
| 1 | +import React from "react"; |
| 2 | +import PropTypes from "prop-types"; |
| 3 | +import { useTranslation } from "react-i18next"; |
| 4 | +import FormInput from "../../util/forms/form-input"; |
| 5 | + |
| 6 | +const BrndFeedType = ({ handleInput, formStateObject, mode }) => { |
| 7 | + const { t } = useTranslation("common", { |
| 8 | + keyPrefix: "brnd-feed-type", |
| 9 | + }); |
| 10 | + |
| 11 | + return ( |
| 12 | + <> |
| 13 | + <FormInput |
| 14 | + name="api_base_uri" |
| 15 | + type="text" |
| 16 | + label={t("api-base-uri")} |
| 17 | + className="mb-2" |
| 18 | + onChange={handleInput} |
| 19 | + placeholder={ |
| 20 | + mode === "PUT" ? t("redacted-value-input-placeholder") : "" |
| 21 | + } |
| 22 | + value={formStateObject?.api_base_uri} |
| 23 | + /> |
| 24 | + |
| 25 | + <FormInput |
| 26 | + name="company_id" |
| 27 | + type="text" |
| 28 | + className="mb-2" |
| 29 | + label={t("company-id")} |
| 30 | + onChange={handleInput} |
| 31 | + placeholder={ |
| 32 | + mode === "PUT" ? t("redacted-value-input-placeholder") : "" |
| 33 | + } |
| 34 | + value={formStateObject?.company_id} |
| 35 | + /> |
| 36 | + |
| 37 | + <FormInput |
| 38 | + name="api_auth_key" |
| 39 | + type="text" |
| 40 | + label={t("api-auth-key")} |
| 41 | + onChange={handleInput} |
| 42 | + placeholder={ |
| 43 | + mode === "PUT" ? t("redacted-value-input-placeholder") : "" |
| 44 | + } |
| 45 | + value={formStateObject?.api_auth_key} |
| 46 | + /> |
| 47 | + </> |
| 48 | + ); |
| 49 | +}; |
| 50 | + |
| 51 | +BrndFeedType.propTypes = { |
| 52 | + handleInput: PropTypes.func, |
| 53 | + formStateObject: PropTypes.shape({ |
| 54 | + api_base_uri: PropTypes.string, |
| 55 | + company_id: PropTypes.string, |
| 56 | + api_auth_key: PropTypes.string, |
| 57 | + }), |
| 58 | + mode: PropTypes.string, |
| 59 | +}; |
| 60 | + |
| 61 | +export default BrndFeedType; |
0 commit comments