Exchange Bitcoin
Buy or sell Bitcoin with a 5% premium
{error &&
{error}
}
{/* Price Display */}
{isPriceLoading && !priceData ? (
Loading price...
) : priceError && !priceData?.price ? (
{priceError}
) : (
<>
Market:
{formatPrice(marketPrice)}
•
Our price:
{formatPrice(agreedPrice)}
{direction === "buy" ? "+" : "-"}
{premiumPercent}%
{lastPriceUpdate && (
Updated {lastPriceUpdate.toLocaleTimeString()}
{isPriceStale && (stale)}
)}
>
)}
{/* Step Indicator */}
1
Exchange Details
2
Book Appointment
{/* Step 1: Exchange Details */}
{wizardStep === "details" && (
{/* Direction Selector */}
{/* Amount Section */}
{/* Trade Summary */}
{direction === "buy" ? (
You buy{" "}
, you sell {formatEur(eurAmount)}
) : (
You buy {formatEur(eurAmount)}, you sell{" "}
)}
{/* Continue Button */}
)}
{/* Step 2: Booking */}
{wizardStep === "booking" && (
<>
{/* Trade Summary Card */}
Your Exchange
{direction === "buy" ? "Buy" : "Sell"} BTC
•
{formatEur(eurAmount)}
↔
{/* Date Selection */}
Select a Date
{dates.map((date) => {
const dateStr = formatDate(date);
const isSelected = selectedDate && formatDate(selectedDate) === dateStr;
const hasAvailability = datesWithAvailability.has(dateStr);
const isDisabled = !hasAvailability || isLoadingAvailability;
return (
);
})}
{/* Available Slots */}
{selectedDate && (
Available Slots for{" "}
{selectedDate.toLocaleDateString("en-US", {
weekday: "long",
month: "long",
day: "numeric",
})}
{isLoadingSlots ? (
Loading slots...
) : availableSlots.length === 0 ? (
No available slots for this date
) : (
{availableSlots.map((slot) => {
const isSelected = selectedSlot?.start_time === slot.start_time;
return (
);
})}
)}
)}
{/* Confirm Booking */}
{selectedSlot && (
Confirm Trade
Time:
{formatTime(selectedSlot.start_time)} - {formatTime(selectedSlot.end_time)}
Direction:
{direction === "buy" ? "Buy BTC" : "Sell BTC"}
EUR:
{formatEur(eurAmount)}
BTC:
Rate:
{formatPrice(agreedPrice)}/BTC
)}
>
)}