import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import makeStyles from "@material-ui/styles/makeStyles"; import React from "react"; import { useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; import SingleSelectField from "@saleor/components/SingleSelectField"; import { FormErrors } from "@saleor/types"; import { FormData } from "../WebhooksDetailsPage"; import { ServiceList_serviceAccounts_edges_node } from "../../types/ServiceList"; interface WebhookInfoProps { data: FormData; disabled: boolean; services: ServiceList_serviceAccounts_edges_node[]; errors: FormErrors<"name" | "targetUrl" | "secretKey">; onChange: (event: React.ChangeEvent) => void; } const useStyles = makeStyles(() => ({ status: { paddingTop: 20 }, title: { fontSize: 16, lineHeight: 1.9, paddingBottom: 10 } })); const WebhookInfo: React.StatelessComponent = ({ data, disabled, services, errors, onChange }) => { const classes = useStyles({}); const intl = useIntl(); return ( {intl.formatMessage({ defaultMessage: "General Information", description: "webhook general information" })}
{intl.formatMessage({ defaultMessage: "Webhook specific information", description: "webhook specific information" })} ({ label: service.name, value: service.id }))} name="serviceAccount" value={data.serviceAccount} label={intl.formatMessage({ defaultMessage: "Assign to Service Account" })} onChange={onChange} />
); }; WebhookInfo.displayName = "WebhookInfo"; export default WebhookInfo;