diff --git a/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx b/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx index f086339..8320211 100644 --- a/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx +++ b/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx @@ -9,7 +9,7 @@ import { Input } from '@/components/ui/input'; import { RichTextEditor } from '@/components/ui/rich-text-editor'; import { Label } from '@/components/ui/label'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; -import { ArrowLeft, Eye, Edit, RotateCcw } from 'lucide-react'; +import { ArrowLeft, Eye, Edit, RotateCcw, Plus, CheckCircle, Info, AlertCircle, Image } from 'lucide-react'; import { toast } from 'sonner'; import { __ } from '@/lib/i18n'; @@ -125,6 +125,30 @@ export default function EditTemplate() { } }; + // Insert card helpers + const insertCard = (type?: string, content?: string) => { + let cardText = ''; + + if (type) { + cardText = `[card type="${type}"] +${content || '

Card Title

\n

Card content goes here...

'} +[/card]\n\n`; + } else { + cardText = `[card] +${content || '

Card Title

\n

Card content goes here...

'} +[/card]\n\n`; + } + + setBody(body + cardText); + toast.success(__('Card inserted')); + }; + + const insertButton = () => { + const buttonHtml = `

Button Text

`; + setBody(body + buttonHtml + '\n'); + toast.success(__('Button inserted')); + }; + // Get variable keys for the rich text editor const variableKeys = Object.keys(variables); @@ -343,6 +367,76 @@ export default function EditTemplate() { + {/* Card Insert Buttons */} + {!codeMode && ( +
+ + {__('Insert Card:')} + + + + + + +
+ +
+ )} + {codeMode ? (