mattermost-mobile/app/screens/channel_files/index.ts
2025-06-19 15:30:56 +08:00

28 lines
1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {withDatabase, withObservables} from '@nozbe/watermelondb/react';
import {observeChannel} from '@queries/servers/channel';
import {observeCanDownloadFiles, observeEnableSecureFilePreview} from '@queries/servers/security';
import {observeConfigBooleanValue} from '@queries/servers/system';
import ChannelFiles from './channel_files';
import type {WithDatabaseArgs} from '@typings/database/database';
type Props = WithDatabaseArgs & {
channelId: string;
}
const enhance = withObservables(['channelId'], ({channelId, database}: Props) => {
const channel = observeChannel(database, channelId);
return {
channel,
canDownloadFiles: observeCanDownloadFiles(database),
enableSecureFilePreview: observeEnableSecureFilePreview(database),
publicLinkEnabled: observeConfigBooleanValue(database, 'EnablePublicLink'),
};
});
export default withDatabase(enhance(ChannelFiles));