mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 19:30:04 +08:00
refactor(MessageAttachments): move styled component definition inside the component for better encapsulation
This commit is contained in:
parent
aeb66195a0
commit
ebdacdde3e
@ -19,6 +19,17 @@ interface Props {
|
|||||||
message: Message
|
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 MessageAttachments: FC<Props> = ({ message }) => {
|
||||||
const handleCopyImage = async (image: FileType) => {
|
const handleCopyImage = async (image: FileType) => {
|
||||||
const data = await FileManager.readFile(image)
|
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 (
|
return (
|
||||||
<Container style={{ marginTop: 2, marginBottom: 8 }} className="message-attachments">
|
<Container style={{ marginTop: 2, marginBottom: 8 }} className="message-attachments">
|
||||||
<StyledUpload
|
<StyledUpload
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user