Skip to content

Commit 003e33e

Browse files
authored
Merge pull request #247 from lyjeileen/files
fix: move supportedViewers out of MultipartData
2 parents 7ff2f54 + f8c45b0 commit 003e33e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/components/multipart/multipart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import React from 'react'
99
import FilePreview from '../filePreview/filePreview'
1010
import Icon from '../icon/icon'
1111
import Text from '../text/text'
12-
import type { MultipartData } from '../types'
12+
import type { MultipartProps } from '../types'
1313

1414
/** The `Multipart` component is a versatile message format designed to accommodate both textual content and file attachments within a single message interface. */
15-
export default function Multipart(props: MultipartData) {
15+
export default function Multipart(props: MultipartProps) {
1616
function renderFiles() {
1717
const files = props.files.map((file, index) => {
1818
return (

src/components/types.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ export interface MultipartFormat extends DataFormat {
236236
files: FileData[]
237237
/** Text content sent along with the files. */
238238
text?: string
239+
}
240+
241+
export type MultipartData = MultipartFormat & Updates<MultipartFormat>
242+
243+
export interface MultipartProps extends MultipartData {
239244
/**
240245
* An object mapping file extensions to their respective viewer components.
241246
* Each key represents a file type (e.g., 'pdf', 'jpg'), and the corresponding value is a React component
@@ -245,8 +250,6 @@ export interface MultipartFormat extends DataFormat {
245250
supportedViewers?: { [key: string]: React.ComponentType<{ url: string }> }
246251
}
247252

248-
export type MultipartData = MultipartFormat & Updates<MultipartFormat>
249-
250253
export interface BaseInputProps {
251254
/** Current user. */
252255
sender: Sender

0 commit comments

Comments
 (0)