- {filtersLoading ? (
-
Loading...
- ) : (
- Object.entries(groupedFilters).map(([group, filters]) => (
-
-
- {FILTER_GROUP_LABEL_KEYS[group]
- ? t(FILTER_GROUP_LABEL_KEYS[group])
- : group}
-
- {filters.map((filter) => (
-
- ))}
-
- ))
+ {/* Telegram Section */}
+ {(channel === 'telegram' || channel === 'both') && (
+
+
+
+ {t('admin.broadcasts.telegramSection')}
+
+
+ {/* Filter selection */}
+
+
+
+
+
+ {showFilters && (
+
+ {filtersLoading ? (
+
Loading...
+ ) : (
+ Object.entries(groupedFilters).map(([group, filters]) => (
+
+
+ {FILTER_GROUP_LABEL_KEYS[group]
+ ? t(FILTER_GROUP_LABEL_KEYS[group])
+ : group}
+
+ {filters.map((filter) => (
+
+ ))}
+
+ ))
+ )}
+
)}
- )}
-
-
-
- {/* Message text */}
-
-
-
-
- {/* Media upload */}
-
-
- {mediaFile ? (
-
-
-
- {mediaType === 'photo' &&
}
- {mediaType === 'video' &&
}
- {mediaType === 'document' &&
}
-
-
{mediaFile.name}
-
- {(mediaFile.size / 1024 / 1024).toFixed(2)} MB
-
-
-
-
-
- {mediaPreview && (
-

- )}
- {isUploading && (
-
- {t('admin.broadcasts.uploading')}
-
- )}
- ) : (
-
-
+
+
- )}
-
- {/* Buttons selection */}
-
-
-
- {buttonsData?.buttons.map((button) => (
-
- ))}
+ {/* Media upload */}
+
+
+ {mediaFile ? (
+
+
+
+ {mediaType === 'photo' &&
}
+ {mediaType === 'video' &&
}
+ {mediaType === 'document' &&
}
+
+
{mediaFile.name}
+
+ {(mediaFile.size / 1024 / 1024).toFixed(2)} MB
+
+
+
+
+
+ {mediaPreview && (
+

+ )}
+ {isUploading && (
+
+ {t('admin.broadcasts.uploading')}
+
+ )}
+
+ ) : (
+
+
+
+
+ )}
+
+
+ {/* Buttons selection */}
+
+
+
+ {buttonsData?.buttons.map((button) => (
+
+ ))}
+
+
-
+ )}
+
+ {/* Email Section */}
+ {(channel === 'email' || channel === 'both') && (
+
+
+
+ {t('admin.broadcasts.emailSection')}
+
+
+ {/* Email filter selection */}
+
+
+
+
+
+ {showEmailFilters && (
+
+ {emailFiltersLoading ? (
+
Loading...
+ ) : (
+ Object.entries(groupedEmailFilters).map(([group, filters]) => (
+
+
+ {FILTER_GROUP_LABEL_KEYS[group]
+ ? t(FILTER_GROUP_LABEL_KEYS[group])
+ : group}
+
+ {filters.map((filter) => (
+
+ ))}
+
+ ))
+ )}
+
+ )}
+
+
+
+ {/* Email subject */}
+
+
+ setEmailSubject(e.target.value)}
+ placeholder={t('admin.broadcasts.emailSubjectPlaceholder')}
+ maxLength={200}
+ className="w-full rounded-lg bg-dark-700 p-3 text-dark-100 placeholder-dark-400 focus:outline-none focus:ring-2 focus:ring-purple-500"
+ />
+
+
+ {/* Email HTML content */}
+
+
+
+
+ )}
- {recipientsCount !== null && (
+ {(channel === 'telegram' || channel === 'both') && telegramRecipientsCount !== null && (
+
+
+ {telegramRecipientsCount}
+
+ )}
+ {(channel === 'email' || channel === 'both') && emailRecipientsCount !== null && (
- {t('admin.broadcasts.willBeSent')}:{' '}
- {recipientsCount}{' '}
- {t('admin.broadcasts.users')}
+
+ {emailRecipientsCount}
)}
@@ -526,7 +838,7 @@ function CreateBroadcastModal({ onClose, onSuccess }: CreateModalProps) {