The copy button sat on its own row above the group's time, costing a line of vertical space for nothing. It now shares that row, left of the timestamp, the way a bot message's actions already do. A file-only message leaves no gap: only messages with text get a button, picked by copyableMessages.
16 lines
376 B
TypeScript
16 lines
376 B
TypeScript
import CopyMessageButton from "./copy-message-button";
|
|
|
|
type Props = {
|
|
text: string;
|
|
};
|
|
|
|
/**
|
|
* One message's copy button, in the row under a user group beside its
|
|
* timestamp. A message with no text renders nothing at all.
|
|
*/
|
|
export default function UserMessageCopy({ text }: Props) {
|
|
if (!text.trim()) return null;
|
|
|
|
return <CopyMessageButton text={text} />;
|
|
}
|