"use client"; import Link from "next/link"; import { useMemo, useState } from "react"; import { insertSetting, deleteSetting, updateSetting, } from "@/app/actions/settings-actions"; import { coinsToRc, parseStoredCoins, rcToCoins, } from "@/lib/coins-rc"; import type { DbSetting } from "@/types/database"; type Props = { rows: DbSetting[]; saveError: boolean; addError: string | null; }; function DefaultSettingRow({ row, index }: { row: DbSetting; index: number }) { const [value, setValue] = useState(row.value ?? ""); const saveDisabled = value.trim() === ""; return (
No settings rows yet. Add one below.
) : (That key already exists. Edit it in the list above instead.
) : addError === "missing" ? (Enter a non-empty key.
) : addError === "missingValue" ? (Enter a non-empty value.
) : addError === "config" ? (Supabase admin client is not configured.
) : addError === "other" ? (Could not insert. Check constraints and retry.
) : null}Back to dashboard