import React, { useState } from 'react'; import { Project } from '../types'; import { exportProjectAsZip } from '../utils/exportZip'; import { UploadCloud, X, ExternalLink, Download, Copy, Check, } from 'lucide-react'; interface DeployModalProps { isOpen: boolean; onClose: () => void; currentProject: Project; } export const DeployModal: React.FC = ({ isOpen, onClose, currentProject, }) => { const [copied, setCopied] = useState(false); const [isExporting, setIsExporting] = useState(false); const [selectedFormat, setSelectedFormat] = useState<'project' | 'template' | 'python'>('project'); if (!isOpen) return null; const projectYamlSnippet = `--- title: ${currentProject.name || 'RiShre – AI Vibe Coding Platform'} emoji: ⚡ colorFrom: purple colorTo: fuchsia sdk: static pinned: false app_build_command: npm run build app_file: build/index.html license: mit ---`; const templateYamlSnippet = `--- title: ${currentProject.name || 'RiShre – AI Vibe Coding Platform'} emoji: ⚡ colorFrom: purple colorTo: fuchsia sdk: static pinned: false app_file: index.html license: mit ---`; const pythonYamlSnippet = `--- title: ${currentProject.name || 'RiShre – AI Vibe Coding Platform'} emoji: ⚡ colorFrom: purple colorTo: fuchsia sdk: docker pinned: false app_file: app.py ---`; const activeSnippet = selectedFormat === 'project' ? projectYamlSnippet : selectedFormat === 'template' ? templateYamlSnippet : pythonYamlSnippet; const handleCopyYaml = () => { navigator.clipboard.writeText(activeSnippet); setCopied(true); setTimeout(() => setCopied(false), 2000); }; const handleDownloadBundle = async () => { setIsExporting(true); try { await exportProjectAsZip(currentProject); } finally { setIsExporting(false); } }; return (
{/* Header */}

Deploy to Hugging Face Spaces (Static)

{/* Content */}

RiShre projects are completely self-contained static web applications optimized for{' '} Hugging Face Static Spaces with free CPU hosting!

1

Create a New Space on Hugging Face

Go to Hugging Face and choose the Static SDK on the free tier.

Open Hugging Face New Space
2

Hugging Face Space README Metadata

{activeSnippet}
💡 Important Space Tip: Static Spaces (sdk: static) serve pure web files directly. Make sure app_file: index.html is used. If set to app_file: app.py, Hugging Face displays the raw Python text instead of executing your website!
3

Download & Push Project ZIP

Download the ZIP package containing your project files along with the pre-configured README.md, then drag-and-drop or git push it to your new Hugging Face Space.

{/* Footer */}
); };