/* This file is part of GNU Taler (C) 2022 Taler Systems S.A. GNU Taler is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Taler; see the file COPYING. If not, see */ import { Amounts } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; import { Checkbox } from "../../components/Checkbox.js"; import { LightText, SmallLightText, SubTitle, Title, } from "../../components/styled/index.js"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Button } from "../../mui/Button.js"; import { TextField } from "../../mui/TextField.js"; import { State } from "./index.js"; export function ConfirmProviderView({ url, provider, tos, onCancel, onAccept, }: State.ConfirmProvider): VNode { const { i18n } = useTranslationContext(); const noFee = Amounts.isZero(provider.annual_fee); return (
<i18n.Translate>Review terms of service</i18n.Translate>
Provider URL:{" "} {url}
Please review and accept this provider's terms of service 1. Pricing

{noFee ? ( free of charge ) : ( {provider.annual_fee} per year of service )}

2. Storage

{provider.storage_limit_in_megabytes} megabytes of storage per year of service

); } export function SelectProviderView({ url, name, urlOk, onCancel, onConfirm, }: State.SelectProvider): VNode { const { i18n } = useTranslationContext(); return (
<i18n.Translate>Add backup provider</i18n.Translate> Backup providers may charge for their service

URL} placeholder="https://" color={urlOk ? "success" : undefined} value={url.value} error={url.error} onChange={url.onInput} />

Name} placeholder="provider name" value={name.value} error={name.error} onChange={name.onInput} />

); }