+ {step === "type" && (
+
+
{t("ads.chooseTypeTitle")}
+
+ {(
+ // "shop" فعلاً کامنت شده — طبق خواستهی کاربر، صفحهی عمومیِ گشتوگذارِ
+ // فروشگاهها وجود نداره، پس فعلاً فقط "product" (کالا) قابلانتخابه
+ [
+ "first_post",
+ "first_story",
+ "notification",
+ "project",
+ "product",
+ // "shop",
+ "billboard",
+ ] as AdType[]
+ ).map((type) => (
+
+ ))}
+
+
+ )}
+
+ {step === "content" && adType === "first_post" && (
+
+
{t("ads.choosePostTitle")}
+ {myPosts === null ? (
+
{t("common.loading")}
+ ) : myPosts.length === 0 ? (
+
{t("ads.noPostsYet")}
+ ) : (
+
+ {myPosts.map((post) => {
+ const thumb = postThumb(post);
+ return (
+
+ );
+ })}
+
+ )}
+
+ )}
+
+ {step === "content" && adType === "first_story" && (
+
+
{t("ads.chooseStoryTitle")}
+ {myStories === null ? (
+
{t("common.loading")}
+ ) : myStories.length === 0 ? (
+
{t("ads.noStoriesYet")}
+ ) : (
+
+ {myStories.map((story) => (
+
+ ))}
+
+ )}
+
+ )}
+
+ {step === "content" && adType === "notification" && (
+
+
{t("ads.notificationContentTitle")}
+
setNotifTitle(e.target.value)}
+ placeholder={t("ads.notificationTitlePlaceholder")}
+ />
+
+ )}
+
+ {step === "content" && adType === "project" && (
+
+
{t("ads.chooseProjectTitle")}
+ {myProjects === null ? (
+
{t("common.loading")}
+ ) : myProjects.length === 0 ? (
+
{t("ads.noProjectsYet")}
+ ) : (
+
+ {myProjects.map((p) => (
+
+ ))}
+
+ )}
+
+ )}
+
+ {step === "content" && adType === "shop" && (
+
+
{t("ads.chooseShopTitle")}
+ {myShops === null ? (
+
{t("common.loading")}
+ ) : myShops.length === 0 ? (
+
{t("ads.noShopsYet")}
+ ) : (
+
+ {myShops.map((shop) => (
+
+ ))}
+
+ )}
+
+ )}
+
+ {step === "content" && adType === "product" && (
+
+
{t("ads.chooseShopTitle")}
+ {myShops === null ? (
+
{t("common.loading")}
+ ) : (
+
+ {myShops.map((shop) => (
+
+ ))}
+
+ )}
+
+ {productShopId && (
+ <>
+
{t("ads.chooseProductTitle")}
+ {shopProducts === null ? (
+
{t("common.loading")}
+ ) : shopProducts.length === 0 ? (
+
{t("ads.noProductsYet")}
+ ) : (
+
+ {shopProducts.map((product) => {
+ const img = product.images?.[product.primaryImageIndex ?? 0] ?? product.images?.[0];
+ return (
+
+ );
+ })}
+
+ )}
+ >
+ )}
+
+ )}
+
+ {step === "content" && adType === "billboard" && (
+
+
{t("ads.chooseBillboardTitle")}
+ {myBillboards === null ? (
+
{t("common.loading")}
+ ) : myBillboards.length === 0 ? (
+
{t("ads.noBillboardsYet")}
+ ) : (
+
+ {myBillboards.map((b) => (
+
+ ))}
+
+ )}
+
+ )}
+
+ {step === "location" && (
+
+
{t("ads.chooseLocationTitle")}
+
+
+ )}
+
+ {step === "expertise" && (
+
+
{t("ads.chooseExpertiseTitle")}
+
+
+ {expertiseList.map((exp) => (
+
+ ))}
+
+
+ {expertise &&
+ (expertiseList.find((e) => e.expertise === expertise)?.sub_expertise?.length ?? 0) > 0 && (
+
+
{t("ads.chooseSubExpertiseTitle")}
+
+ {(expertiseList.find((e) => e.expertise === expertise)?.sub_expertise ?? []).map(
+ (sub) => (
+
+ )
+ )}
+
+
+ )}
+
+ )}
+
+ {step === "gender" && (
+
+
{t("ads.chooseGenderTitle")}
+
+ {(["female", "male", "any"] as const).map((g) => (
+
+ ))}
+
+
+ )}
+
+ {step === "review" && (
+
+
{t("ads.reviewTitle")}
+
+
{t(`ads.type.${adType}`)}
+
+
+
{t("ads.priceLabel")}
+
+ {priceLoading
+ ? "..."
+ : price != null
+ ? `${price.toLocaleString()} ${t("common.toman")}`
+ : t("ads.priceUnavailable")}
+
+
+ {/* dir=ltr تا در صفحه RTL هم قبلی سمت چپ فیزیکی و پرداخت سمت راست بماند */}
+
+
+ {t("ads.backAction")}
+
+
+ {submitting ? t("common.loading") : t("ads.payAndPublish")}
+
+
+
+ )}
+
+ {step !== "review" && (
+
+
+ {t("ads.nextAction")}
+
+
+ {t("ads.backAction")}
+
+
+ )}
+
+