Files
Rs_blog_front/src/components/editor/MarkdownEditor.tsx
2026-02-11 19:46:38 +08:00

29 lines
709 B
TypeScript

"use client";
import { type ChangeEvent } from "react";
import clsx from "clsx";
interface MarkdownEditorProps {
value: string;
onChange: (value: string) => void;
className?: string;
}
export function MarkdownEditor({ value, onChange, className }: MarkdownEditorProps) {
const handleChange = (e: ChangeEvent<HTMLTextAreaElement>) => {
onChange(e.target.value);
};
return (
<textarea
value={value}
onChange={handleChange}
placeholder="Write your content in Markdown..."
className={clsx(
"w-full h-full resize-none bg-transparent font-mono text-sm leading-relaxed focus:outline-none placeholder:text-neutral-400",
className
)}
/>
);
}