feat: render the connection-warning block from backend data per service

Replaces the hardcoded "⚠️ اتصال سرویس‌ها" text (shown for every product)
with data.has_connection_notice / data.connection_notice from the
config's own see() response, so it's opt-in per service instead of
always-on for the whole category.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-22 01:14:33 +03:30
parent e1a84105c7
commit bbf1fc8899

View File

@@ -61,6 +61,10 @@ const ModalBuy = ({ isOpen, setIsOpen, configId }: ModalBuyProps) => {
data?.data?.result?.has_extra_description
);
const extraDescriptionSections = data?.data?.result?.extra_description ?? [];
const hasConnectionNotice = Boolean(
data?.data?.result?.has_connection_notice
);
const connectionNotice = data?.data?.result?.connection_notice ?? "";
const advancedVerificationFromApi =
data?.data?.result?.requires_advanced_verification;
const hasAdvancedVerificationApiFlag =
@@ -361,10 +365,12 @@ const ModalBuy = ({ isOpen, setIsOpen, configId }: ModalBuyProps) => {
کاربر گرامی لطفا از خاموش بودن vpn خود اطمینان حاصل فرمایید تا در
درگاه پرداخت مشکلی نداشته باشید{" "}
</Alert>
<div className="w-full bg-gray-800 rounded-md p-2 text-xs text-gray-400 leading-6 text-right">
<p className="font-bold text-yellow-400 text-xs mb-1">⚠️ اتصال سرویس‌ها</p>
<p>با توجه به شرایط فعلی، هیچ تضمینی برای اتصال دائمی سرویس‌ها وجود ندارد. ممکن است اتصال مجدداً قطع شود یا حتی در برخی مواقع امکان برقراری آن فراهم نشود. با این حال، تمام تلاش خود را می‌کنیم تا هر چه سریع‌تر مشکل را برطرف کنیم. از همراهی و صبوری شما سپاسگزاریم.</p>
</div>
{hasConnectionNotice && (
<div className="w-full bg-gray-800 rounded-md p-2 text-xs text-gray-400 leading-6 text-right">
<p className="font-bold text-yellow-400 text-xs mb-1">⚠️ اتصال سرویس</p>
<p>{connectionNotice}</p>
</div>
)}
<h1 className="font-bold">
مبلغ قابل پرداخت :{" "}
<span className="px-[2px] rounded-md bg-secondTheme text-gray-950">