mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 11:20:07 +08:00
refactor(MessageAttachments): move styled component definition inside the component for better encapsulation
This commit is contained in:
parent
e2396f3f14
commit
17eeab2897
@ -19,6 +19,17 @@ interface Props {
|
||||
message: Message
|
||||
}
|
||||
|
||||
const StyledUpload = styled(Upload)`
|
||||
.ant-upload-list-item-name {
|
||||
max-width: 220px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
`
|
||||
|
||||
const MessageAttachments: FC<Props> = ({ message }) => {
|
||||
const handleCopyImage = async (image: FileType) => {
|
||||
const data = await FileManager.readFile(image)
|
||||
@ -66,17 +77,6 @@ const MessageAttachments: FC<Props> = ({ message }) => {
|
||||
)
|
||||
}
|
||||
|
||||
const StyledUpload = styled(Upload)`
|
||||
.ant-upload-list-item-name {
|
||||
max-width: 220px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
`
|
||||
|
||||
return (
|
||||
<Container style={{ marginTop: 2, marginBottom: 8 }} className="message-attachments">
|
||||
<StyledUpload
|
||||
|
||||
Loading…
Reference in New Issue
Block a user