refactor: message wrapper

This commit is contained in:
Tristan Yang
2023-03-11 11:16:12 +08:00
parent 3302a87434
commit 7fcbfb3693
2 changed files with 29 additions and 25 deletions
+4 -2
View File
@@ -1,10 +1,12 @@
import { FC } from "react";
import clsx from "clsx";
interface Props {
content: string;
className?: string
}
const Divider: FC<Props> = ({ content }) => {
return <div className="relative border-none h-[1px] bg-slate-200 dark:bg-gray-500 my-6 overflow-visible">
const Divider: FC<Props> = ({ content, className = "" }) => {
return <div className={clsx("relative border-none h-[1px] bg-slate-200 dark:bg-gray-500 my-6 overflow-visible", className)}>
<span className="p-1 absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-xs text-gray-500 dark:text-gray-300 font-semibold bg-white dark:bg-gray-700">{content}</span>
</div>;
};