'use client' import { useState } from 'react' import { useRouter } from 'next/navigation' import { createOrUpdateBlogPostAction } from '@/app/actions' import { ArrowLeft, Save, Eye, Edit3 } from 'lucide-react' import { Link } from '@/i18n/routing' interface Option { value: string label: string } interface FormProps { post: any | null listingOptions: Option[] } // Simple local markdown preview renderer helper function previewMarkdown(md: string): string { if (!md) return '' let html = md .replace(/&/g, '&') .replace(//g, '>') html = html.replace(/\*\*(.*?)\*\*/g, '$1') html = html.replace(/\*(.*?)\*/g, '$1') html = html.replace(/^### (.*?)$/gm, '