diff --git a/app/_components/_admin/admin-blog-form.tsx b/app/_components/_admin/admin-blog-form.tsx index f3ff811..cbbe288 100644 --- a/app/_components/_admin/admin-blog-form.tsx +++ b/app/_components/_admin/admin-blog-form.tsx @@ -12,23 +12,16 @@ import Markdown from '@/components/markdown'; import { Checkbox } from '@/components/ui/checkbox'; import { revalidatePathClient } from '@/helpers/revalidate-path-client'; -type Props = { - id?: number; - title?: string; - tag?: string; - content?: string; - cover?: string | null; - draft?: boolean; -}; +type Props = Partial<{ + id: number; + title: string; + tag: string; + content: string; + cover: string | null; + draft: boolean; +}>; -export default function AdminBlogForm({ - id, - title = '', - tag = '', - content = '', - cover, - draft = false, -}: Props) { +export default function AdminBlogForm({ id, title, tag, content, cover, draft = false }: Props) { const [state, action] = useFormState(adminBlogSubmit, undefined); const [contentState, setContentState] = useState(content); diff --git a/components/markdown.tsx b/components/markdown.tsx index 7e33a10..7176065 100644 --- a/components/markdown.tsx +++ b/components/markdown.tsx @@ -81,6 +81,7 @@ const Markdown = ({ markdown }: { markdown: string }) => { dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(marked.parse(markdown) as string, { USE_PROFILES: { html: true }, + ADD_ATTR: ['onclick'], }), }} >