2025-08-05 14:39:27 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { Stack, Box } from '@mantine/core';
|
|
|
|
import FileSourceButtons from './FileSourceButtons';
|
|
|
|
import FileDetails from './FileDetails';
|
|
|
|
import SearchInput from './SearchInput';
|
|
|
|
import FileListArea from './FileListArea';
|
|
|
|
import HiddenFileInput from './HiddenFileInput';
|
2025-08-05 15:55:35 +01:00
|
|
|
import { useFileManagerContext } from './FileManagerContext';
|
2025-08-05 14:39:27 +01:00
|
|
|
|
2025-08-05 15:55:35 +01:00
|
|
|
const MobileLayout: React.FC = () => {
|
|
|
|
const {
|
|
|
|
activeSource,
|
|
|
|
selectedFiles,
|
|
|
|
modalHeight,
|
|
|
|
} = useFileManagerContext();
|
2025-08-05 14:39:27 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Stack h="100%" gap="sm" p="sm">
|
|
|
|
{/* Section 1: File Sources - Fixed at top */}
|
|
|
|
<Box style={{ flexShrink: 0 }}>
|
2025-08-05 15:55:35 +01:00
|
|
|
<FileSourceButtons horizontal={true} />
|
2025-08-05 14:39:27 +01:00
|
|
|
</Box>
|
|
|
|
|
|
|
|
<Box style={{ flexShrink: 0 }}>
|
2025-08-05 15:55:35 +01:00
|
|
|
<FileDetails compact={true} />
|
2025-08-05 14:39:27 +01:00
|
|
|
</Box>
|
|
|
|
|
|
|
|
{/* Section 3: Search Bar - Fixed above file list */}
|
|
|
|
{activeSource === 'recent' && (
|
|
|
|
<Box style={{ flexShrink: 0 }}>
|
2025-08-05 15:55:35 +01:00
|
|
|
<SearchInput />
|
2025-08-05 14:39:27 +01:00
|
|
|
</Box>
|
|
|
|
)}
|
|
|
|
|
|
|
|
{/* Section 4: File List - Fixed height scrollable area */}
|
|
|
|
<Box style={{ flexShrink: 0 }}>
|
|
|
|
<FileListArea
|
|
|
|
scrollAreaHeight={`calc(${modalHeight} - ${selectedFiles.length > 0 ? '300px' : '200px'})`}
|
|
|
|
scrollAreaStyle={{ maxHeight: '400px', minHeight: '150px' }}
|
|
|
|
/>
|
|
|
|
</Box>
|
|
|
|
|
|
|
|
{/* Hidden file input for local file selection */}
|
2025-08-05 15:55:35 +01:00
|
|
|
<HiddenFileInput />
|
2025-08-05 14:39:27 +01:00
|
|
|
</Stack>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default MobileLayout;
|