import { Check } from 'lucide-react'; import { useGoogleQuota } from '../../../components/Admin/useGoogleQuota'; import { NumericInput } from '../../../components/shared/NumericInput'; import { useTranslation } from '../../../i18n'; import MHintLabel from '../../components/MHintLabel'; import { MAdminButton } from './MAdminUi'; /** * The daily cap on Google requests, the phone's form of the desktop * GoogleDailyLimitRow: today's count under the name (in the warning colour once * the day is used up), the cap in a small field, and a save while it differs. */ export default function MAdminGoogleDailyLimit() { const { t } = useTranslation(); const { status, draft, setDraft, dirty, saving, save } = useGoogleQuota(); let today: string | null = null; if (status) { if (status.exhausted) today = t('admin.googleQuota.reached', { used: status.used_today }); else if (status.daily_limit == null) today = t('admin.googleQuota.usedToday', { used: status.used_today }); else today = t('admin.googleQuota.usedOfLimit', { used: status.used_today, limit: status.daily_limit }); } return (
{today}
)}