build: format the code with prettier
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { FC } from "react";
|
||||
import clsx from "clsx";
|
||||
import renderContent from "./renderContent";
|
||||
import Avatar from "../Avatar";
|
||||
|
||||
import { useAppSelector } from "@/app/store";
|
||||
import Avatar from "../Avatar";
|
||||
import renderContent from "./renderContent";
|
||||
|
||||
interface Props {
|
||||
mid?: number;
|
||||
context?: "forward" | "pin"
|
||||
context?: "forward" | "pin";
|
||||
}
|
||||
|
||||
const PreviewMessage: FC<Props> = ({ mid = 0, context = "forward" }) => {
|
||||
@@ -19,15 +20,32 @@ const PreviewMessage: FC<Props> = ({ mid = 0, context = "forward" }) => {
|
||||
const pinMsg = context == "pin";
|
||||
const forwardMsg = context == "forward";
|
||||
return (
|
||||
<div className={clsx(`w-full relative flex items-start gap-3 p-2 my-2 rounded-lg`, pinMsg && "max-h-64 overflow-auto overflow-x-hidden border border-solid border-gray-200 dark:border-gray-400")}>
|
||||
<div
|
||||
className={clsx(
|
||||
`w-full relative flex items-start gap-3 p-2 my-2 rounded-lg`,
|
||||
pinMsg &&
|
||||
"max-h-64 overflow-auto overflow-x-hidden border border-solid border-gray-200 dark:border-gray-400"
|
||||
)}
|
||||
>
|
||||
<div className="w-10 h-10 flex shrink-0">
|
||||
<Avatar width={40} height={40} className="rounded-full object-cover" src={avatar} name={name} />
|
||||
<Avatar
|
||||
width={40}
|
||||
height={40}
|
||||
className="rounded-full object-cover"
|
||||
src={avatar}
|
||||
name={name}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full flex flex-col items-start">
|
||||
<div className="flex items-center gap-2 font-semibold">
|
||||
<span className="text-gray-500 text-sm">{name}</span>
|
||||
</div>
|
||||
<div className={clsx(`select-text text-gray-600 text-sm break-all whitespace-pre-wrap dark:text-white`, forwardMsg && "max-h-72 overflow-y-scroll")}>
|
||||
<div
|
||||
className={clsx(
|
||||
`select-text text-gray-600 text-sm break-all whitespace-pre-wrap dark:text-white`,
|
||||
forwardMsg && "max-h-72 overflow-y-scroll"
|
||||
)}
|
||||
>
|
||||
{renderContent({
|
||||
content_type,
|
||||
content,
|
||||
|
||||
Reference in New Issue
Block a user