import React, { useState, useEffect } from "react"; import { motion } from "framer-motion"; export default function GoldSilverBuyerLanding() { const [form, setForm] = useState({ name: "", phone: "", email: "", note: "" }); const [status, setStatus] = useState(null); const [goldPrice, setGoldPrice] = useState(null); const [silverPrice, setSilverPrice] = useState(null); const [gramsGold, setGramsGold] = useState(0); const [gramsSilver, setGramsSilver] = useState(0); const [estimatedGold, setEstimatedGold] = useState(0); const [estimatedSilver, setEstimatedSilver] = useState(0); useEffect(() => { fetchPrices(); }, []); async function fetchPrices() { try { const res = await fetch("https://api.metals.dev/v1/latest?api_key=demo&base=USD&symbols=XAU,XAG"); const data = await res.json(); const gold = data?.metals?.XAU || 0; const silver = data?.metals?.XAG || 0; setGoldPrice(gold); setSilverPrice(silver); } catch (err) { console.error("Price fetch error", err); setGoldPrice(null); setSilverPrice(null); } } useEffect(() => { if (goldPrice && gramsGold) { const val = (goldPrice / 31.1035) * gramsGold; setEstimatedGold(val); } }, [goldPrice, gramsGold]); useEffect(() => { if (silverPrice && gramsSilver) { const val = (silverPrice / 31.1035) * gramsSilver; setEstimatedSilver(val); } }, [silverPrice, gramsSilver]); function handleChange(e) { const { name, value } = e.target; setForm((s) => ({ ...s, [name]: value })); } async function handleSubmit(e) { e.preventDefault(); setStatus({ type: "sending", message: "שולח..." }); try { const res = await fetch("/api/leads", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(form), }); if (res.ok) { setStatus({ type: "success", message: "תודה! נחזור אליך בהקדם." }); setForm({ name: "", phone: "", email: "", note: "" }); } else { throw new Error(); } } catch { setStatus({ type: "error", message: "אירעה שגיאה בשליחה, אנא נסה שוב." }); } } return (

קניית זהב וכסף | buygold-silver.co.il

קונים זהב וכסף במזומן או בהעברה – במהירות, אמינות ומקצועיות.

מתמחים ברכישת מטילי זהב, תכשיטים, מטבעות, וכלי כסף – בתמחור שקוף ותשלום מיידי.

השאירו פרטים ונחזור אליכם
מטילי זהב

למה לבחור בנו

מקצועיות

מומחים עם ניסיון של שנים בשוק ההשקעות והמתכות היקרות.

אמינות

שקיפות מלאה בתמחור, הצעות הוגנות, ותיעוד מלא של כל עסקה.

שירות אישי

יחס חם ואדיב, תיאום גמיש בבית הלקוח או במשרד.

מחשבון זהב וכסף בזמן אמת

{goldPrice ? ( <>

מחשבון זהב

מחיר זהב עכשווי (דולר לאונקיה): ${goldPrice.toFixed(2)}

setGramsGold(Number(e.target.value))} className="border rounded-md p-2 w-40 text-center" />
{gramsGold > 0 && (

ערך משוער: ${(estimatedGold).toFixed(2)} דולר

)} ) : (

טוען נתוני מחיר זהב...

)}
{silverPrice ? ( <>

מחשבון כסף

מחיר כסף עכשווי (דולר לאונקיה): ${silverPrice.toFixed(2)}

setGramsSilver(Number(e.target.value))} className="border rounded-md p-2 w-40 text-center" />
{gramsSilver > 0 && (

ערך משוער: ${(estimatedSilver).toFixed(2)} דולר

)} ) : (

טוען נתוני מחיר כסף...

)}

צור קשר לקבלת הצעה