/** * Form to set the stripe's public and private keys */ import React, { useEffect, useState } from 'react'; import { Loader } from './loader'; import { useTranslation } from 'react-i18next'; import SettingAPI from '../api/setting'; import { SettingName } from '../models/setting'; interface StripeKeysFormProps { param: string } const stripeKeys = SettingAPI.query([SettingName.StripePublicKey, SettingName.StripeSecretKey]); const StripeKeysFormComponent: React.FC = ({ param }) => { const { t } = useTranslation('admin'); const [publicKey, setPublicKey] = useState(''); const [secretKey, setSecretKey] = useState(''); useEffect(() => { const keys = stripeKeys.read(); setPublicKey(keys.get(SettingName.StripePublicKey)); setSecretKey(keys.get(SettingName.StripeSecretKey)); }, []); // see StripeKeysModalController // from app/frontend/src/javascript/controllers/admin/invoices.js return (
); } export const StripeKeysForm: React.FC = ({ param }) => { return ( ); }