Improve shortcode UI display in NotifikasiTab and EmailTemplatePreview
✨ Enhanced shortcode organization and display: **NotifikasiTab improvements:** - Organized shortcodes into 9 categories with color-coded badges - User Info (blue), Order Info (green), Product Info (yellow), Access Info (purple) - Consulting (orange), Event Info (pink), Bootcamp Info (indigo), Company Info (gray), Payment Info (red) - Added scrollable container with max-height for better UX - Better visual hierarchy with category headers **EmailTemplatePreview improvements:** - Scrollable shortcode list with grid layout (2-3 columns) - Show only shortcodes used in current template - Add "All Available Shortcodes" summary section - Improved visual organization with consistent styling 🎨 UI/UX Benefits: - Easier to find relevant shortcodes by category - Visual distinction between different data types - Better space utilization with scrollable areas - More informative and scannable layout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,10 +25,24 @@ interface NotificationTemplate {
|
||||
}
|
||||
|
||||
const SHORTCODES_HELP = {
|
||||
common: ['{nama}', '{email}', '{order_id}', '{tanggal_pesanan}', '{total}', '{metode_pembayaran}'],
|
||||
access: ['{produk}', '{link_akses}'],
|
||||
consulting: ['{tanggal_konsultasi}', '{jam_konsultasi}', '{link_meet}'],
|
||||
event: ['{judul_event}', '{tanggal_event}', '{jam_event}', '{link_event}'],
|
||||
// User information
|
||||
common: ['{nama}', '{email}'],
|
||||
// Order information
|
||||
orders: ['{order_id}', '{tanggal_pesanan}', '{total}', '{metode_pembayaran}', '{status_pesanan}', '{invoice_url}'],
|
||||
// Product information
|
||||
products: ['{produk}', '{kategori_produk}', '{harga_produk}', '{deskripsi_produk}'],
|
||||
// Access information
|
||||
access: ['{link_akses}', '{username_akses}', '{password_akses}', '{kadaluarsa_akses}'],
|
||||
// Consulting information
|
||||
consulting: ['{tanggal_konsultasi}', '{jam_konsultasi}', '{durasi_konsultasi}', '{link_meet}', '{jenis_konsultasi}', '{topik_konsultasi}'],
|
||||
// Event information
|
||||
event: ['{judul_event}', '{tanggal_event}', '{jam_event}', '{link_event}', '{lokasi_event}', '{kapasitas_event}'],
|
||||
// Bootcamp/Course information
|
||||
bootcamp: ['{judul_bootcamp}', '{progres_bootcamp}', '{modul_selesai}', '{modul_selanjutnya}', '{link_progress}'],
|
||||
// Company information
|
||||
company: ['{nama_perusahaan}', '{website_perusahaan}', '{email_support}', '{telepon_support}'],
|
||||
// Payment information
|
||||
payment: ['{bank_tujuan}', '{nomor_rekening}', '{atas_nama}', '{jumlah_pembayaran}', '{batas_pembayaran}'],
|
||||
};
|
||||
|
||||
const DEFAULT_TEMPLATES: { key: string; name: string; defaultSubject: string; defaultBody: string }[] = [
|
||||
@@ -550,21 +564,81 @@ export function NotifikasiTab() {
|
||||
<CardContent className="space-y-4">
|
||||
<div className="text-sm text-muted-foreground p-3 bg-muted rounded-md space-y-2">
|
||||
<p className="font-medium">Shortcode yang tersedia:</p>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-2">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 max-h-48 overflow-y-auto">
|
||||
<div>
|
||||
<span className="font-medium">Umum:</span> {SHORTCODES_HELP.common.join(', ')}
|
||||
<span className="font-medium block mb-1">User Info:</span>
|
||||
<div className="text-xs space-y-1">
|
||||
{SHORTCODES_HELP.common.map(code => (
|
||||
<code key={code} className="bg-blue-100 px-1 py-0.5 rounded text-xs mr-1">{code}</code>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium">Akses:</span> {SHORTCODES_HELP.access.join(', ')}
|
||||
<span className="font-medium block mb-1">Order Info:</span>
|
||||
<div className="text-xs space-y-1">
|
||||
{SHORTCODES_HELP.orders.map(code => (
|
||||
<code key={code} className="bg-green-100 px-1 py-0.5 rounded text-xs mr-1">{code}</code>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium">Konsultasi:</span> {SHORTCODES_HELP.consulting.join(', ')}
|
||||
<span className="font-medium block mb-1">Product Info:</span>
|
||||
<div className="text-xs space-y-1">
|
||||
{SHORTCODES_HELP.products.map(code => (
|
||||
<code key={code} className="bg-yellow-100 px-1 py-0.5 rounded text-xs mr-1">{code}</code>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium">Event:</span> {SHORTCODES_HELP.event.join(', ')}
|
||||
<span className="font-medium block mb-1">Access Info:</span>
|
||||
<div className="text-xs space-y-1">
|
||||
{SHORTCODES_HELP.access.map(code => (
|
||||
<code key={code} className="bg-purple-100 px-1 py-0.5 rounded text-xs mr-1">{code}</code>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-xs mt-2 p-2 bg-background rounded border">
|
||||
<div>
|
||||
<span className="font-medium block mb-1">Consulting:</span>
|
||||
<div className="text-xs space-y-1">
|
||||
{SHORTCODES_HELP.consulting.map(code => (
|
||||
<code key={code} className="bg-orange-100 px-1 py-0.5 rounded text-xs mr-1">{code}</code>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium block mb-1">Event Info:</span>
|
||||
<div className="text-xs space-y-1">
|
||||
{SHORTCODES_HELP.event.map(code => (
|
||||
<code key={code} className="bg-pink-100 px-1 py-0.5 rounded text-xs mr-1">{code}</code>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium block mb-1">Bootcamp Info:</span>
|
||||
<div className="text-xs space-y-1">
|
||||
{SHORTCODES_HELP.bootcamp.map(code => (
|
||||
<code key={code} className="bg-indigo-100 px-1 py-0.5 rounded text-xs mr-1">{code}</code>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium block mb-1">Company Info:</span>
|
||||
<div className="text-xs space-y-1">
|
||||
{SHORTCODES_HELP.company.map(code => (
|
||||
<code key={code} className="bg-gray-100 px-1 py-0.5 rounded text-xs mr-1">{code}</code>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium block mb-1">Payment Info:</span>
|
||||
<div className="text-xs space-y-1">
|
||||
{SHORTCODES_HELP.payment.map(code => (
|
||||
<code key={code} className="bg-red-100 px-1 py-0.5 rounded text-xs mr-1">{code}</code>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-xs mt-3 p-2 bg-background rounded border">
|
||||
<strong>Penting:</strong> Email dikirim melalui Mailketing API yang dikonfigurasi di tab Integrasi.
|
||||
Pastikan API token valid dan domain pengirim sudah terdaftar di Mailketing.
|
||||
Toggle "Aktifkan" hanya mengontrol pengiriman email. Jika <code>webhook_url</code> diisi,
|
||||
|
||||
Reference in New Issue
Block a user