import { Space, Tooltip, Typography } from "antd";
import { type Change, diffChars } from "diff"
import User from "../auth/User";
import TimeShow from "../general/TimeShow";
import type { ISentHistoryData } from "./SentHistory"
const { Text, Paragraph } = Typography;
interface IWidget {
data?: ISentHistoryData;
oldContent?: string;
}
const SentHistoryItemWidget = ({ data, oldContent }: IWidget) => {
let content = {data?.content};
if (data?.content && oldContent) {
const diff: Change[] = diffChars(oldContent, data.content);
const diffResult = diff.map((item, id) => {
return (
{item.value}
);
});
content = {diffResult};
}
return (
{content}
);
};
export default SentHistoryItemWidget;