Refactor MessageHide component layout to improve badge visibility; separate message text and badge into distinct sections for better user experience

This commit is contained in:
ecwu
2024-12-21 21:44:16 +08:00
parent 001bc479c2
commit a80aacce5a

View File

@@ -8,9 +8,13 @@ interface Props {
export function MessageHide({ chat }: Props) { export function MessageHide({ chat }: Props) {
return ( return (
<>
<div className="flex items-center gap-2 text-sm text-muted-foreground"> <div className="flex items-center gap-2 text-sm text-muted-foreground">
<span>{getMessageText(chat).split("\n")[0].slice(0, 18)} ...</span> <span>{getMessageText(chat).split("\n")[0].slice(0, 18)} ...</span>
<Badge variant="secondary">Removed from context</Badge>
</div> </div>
<div className="flex justify-center">
<Badge variant="destructive">Removed from context</Badge>
</div>
</>
); );
} }