jerry 1 ماه پیش
والد
کامیت
d2f38e9aea
2فایلهای تغییر یافته به همراه17 افزوده شده و 5 حذف شده
  1. 14 2
      src/app/slots/page.tsx
  2. 3 3
      src/components/slots/CitySlotCard.tsx

+ 14 - 2
src/app/slots/page.tsx

@@ -12,6 +12,18 @@ const LOCATIONS = [
   { code: 'SG', name: 'Singapore', flag: '🇸🇬', cities: ['Singapore'] }
 ];
 
+const SUBSCRIPTION_BLACKLIST = [
+  { city: 'Dublin', country: 'France' },
+];
+
+const isBlacklisted = (slot: SlotSnapshot) => {
+  return SUBSCRIPTION_BLACKLIST.some(
+    (item) =>
+      item.city.toLowerCase() === slot.city?.toLowerCase() &&
+      item.country.toLowerCase() === slot.country?.toLowerCase()
+  );
+};
+
 export default function SlotDashboardPage() {
   const { t } = useLanguage();
   const [loading, setLoading] = useState(true);
@@ -211,7 +223,7 @@ export default function SlotDashboardPage() {
         ) : (
           <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
             {snapshots.map((slot) => (
-              <CitySlotCard key={slot.id} data={slot} />
+              <CitySlotCard key={slot.id} data={slot} isBlacklisted={isBlacklisted(slot)} />
             ))}
           </div>
         )}
@@ -219,4 +231,4 @@ export default function SlotDashboardPage() {
       </div>
     </div>
   );
-}
+}

+ 3 - 3
src/components/slots/CitySlotCard.tsx

@@ -22,7 +22,7 @@ export interface SlotSnapshot {
   };
 }
 
-export default function CitySlotCard({ data }: { data: SlotSnapshot }) {
+export default function CitySlotCard({ data, isBlacklisted = false }: { data: SlotSnapshot; isBlacklisted?: boolean }) {
   const { t, lang } = useLanguage();
   const router = useRouter();
   
@@ -121,7 +121,7 @@ export default function CitySlotCard({ data }: { data: SlotSnapshot }) {
   const slotCity = data.city;
   const slotCountry = data.country;
   const slotVisaType = data.visa_type;
-  const canSubscribe = Boolean(slotRoutingKey);
+  const canSubscribe = Boolean(slotRoutingKey) && !isBlacklisted;
 
   const handleSubscribe = () => {
     if (!slotRoutingKey) return;
@@ -258,7 +258,7 @@ export default function CitySlotCard({ data }: { data: SlotSnapshot }) {
           >
             {t('slots.subscribe_notification') || 'Subscribe for updates'}
           </button>
-          {!canSubscribe && (
+          {!canSubscribe && !isBlacklisted && (
             <p className="text-xs text-slate-400 mt-1">
               {t('slots.subscribe_unavailable') || 'Routing info unavailable'}
             </p>