link-stack/apps/link/metamigo-add/_components/voice/providers/ProviderEdit.tsx

32 lines
771 B
TypeScript
Raw Normal View History

2023-06-28 12:55:24 +00:00
"use client";
2023-02-13 12:41:30 +00:00
import {
SimpleForm,
TextInput,
PasswordInput,
Edit,
EditProps,
} from "react-admin";
import { ProviderKindInput } from "./shared";
const ProviderTitle = ({ record }: { record?: any }) => {
let title = "";
2023-03-15 12:17:43 +00:00
if (record) title = record.name ?? record.email;
2023-02-13 12:41:30 +00:00
return <span>Provider {title}</span>;
};
2023-03-15 12:17:43 +00:00
const ProviderEdit = (props: EditProps) => (
<Edit title={<ProviderTitle />} {...props}>
<SimpleForm>
<TextInput disabled source="id" />
<ProviderKindInput disabled />
<TextInput source="name" />
<TextInput source="credentials.accountSid" />
<TextInput source="credentials.apiKeySid" />
<PasswordInput source="credentials.apiKeySecret" />
</SimpleForm>
</Edit>
);
2023-02-13 12:41:30 +00:00
export default ProviderEdit;