mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
refactor: consolidate environment config and API handling
- Update database paths and port configuration - Remove backend config.ts and sessions route - Add mobile file preview and files API - Clean up shared constants and provider hooks
This commit is contained in:
1 parent
0db354048d
commit
8a56bc208d
32 files changed
+301
-512
No files matched your search
@@ -0,0 +1,57 @@
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import { FilePreview } from "./FilePreview";
|
||||
import { X } from "lucide-react";
|
||||
import type { FileInfo } from "@/types/files";
|
||||
|
||||
interface MobileFilePreviewModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
file: FileInfo | null;
|
||||
showFilePreviewHeader?: boolean;
|
||||
}
|
||||
|
||||
export function MobileFilePreviewModal({
|
||||
isOpen,
|
||||
onClose,
|
||||
file,
|
||||
showFilePreviewHeader = false,
|
||||
}: MobileFilePreviewModalProps) {
|
||||
const handleTouchStart = (e: React.TouchEvent) => {
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
const handleTouchEnd = (e: React.TouchEvent) => {
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
if (!file || file.isDirectory) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog open={isOpen} onOpenChange={(open) => !open && onClose()} hideCloseButton={true}>
|
||||
<DialogContent
|
||||
className="w-screen h-screen max-w-none max-h-none p-0 bg-background border-0 flex flex-col"
|
||||
onTouchStart={handleTouchStart}
|
||||
onTouchEnd={handleTouchEnd}
|
||||
>
|
||||
<div
|
||||
className={`flex-1 overflow-hidden min-h-0 ${showFilePreviewHeader ? "" : "pb-8"}`}
|
||||
>
|
||||
<FilePreview
|
||||
file={file}
|
||||
hideHeader={!showFilePreviewHeader}
|
||||
isMobileModal={showFilePreviewHeader}
|
||||
onCloseModal={onClose}
|
||||
/>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user