mattermost-mobile/share_extension/components/content_view/attachments/shared_upload_item.tsx
Rajat Dabade 71fed8aa50
(Android) Common component for upload item for main application and share extension (#9028)
* Common component for upload item for main application and share extension

* Addressed review comments

* intl fixes

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-09-11 12:54:54 +05:30

31 lines
864 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import UploadItemShared from '@components/upload_item_shared';
import {sharedItemToUploadItemFile} from '@components/upload_item_shared/adapters';
import type {SharedItem} from '@mattermost/rnshare';
type Props = {
file: SharedItem;
fullWidth?: boolean;
hasError?: boolean;
};
const SharedUploadItem = ({file, fullWidth = false, hasError = false}: Props) => {
const uploadItemFile = sharedItemToUploadItemFile(file);
return (
<UploadItemShared
file={uploadItemFile}
testID={`shared_upload_item_${file.value}`}
fullWidth={fullWidth}
isShareExtension={true}
hasError={hasError}
/>
);
};
export default SharedUploadItem;