import { useMemo } from 'react'; import { Avatar, Box, Button, Chip, Dialog, DialogContent, IconButton, Link, Typography, } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder'; import VerifiedIcon from '@mui/icons-material/Verified'; import DownloadIcon from '@mui/icons-material/Download'; import OpenInNewIcon from '@mui/icons-material/OpenInNew'; import ComputerIcon from '@mui/icons-material/Computer'; function InstallModal({ open, onClose, app }) { // Detect Linux users const isLinux = useMemo(() => { if (typeof navigator === 'undefined') return false; const platform = navigator.platform?.toLowerCase() || ''; const userAgent = navigator.userAgent?.toLowerCase() || ''; return platform.includes('linux') || userAgent.includes('linux'); }, []); if (!app) return null; const appName = app.name || app.id?.split('/').pop(); const cardData = app.cardData || {}; const emoji = cardData.emoji || '📦'; const description = cardData.short_description || app.description || 'No description'; const deepLinkUrl = `reachymini://install/${appName}`; const spaceUrl = `https://huggingface.co/spaces/${app.id}`; const author = app.id?.split('/')?.[0] || app.author || null; const isOfficial = app.isOfficial; const likes = app.likes || 0; const lastModified = app.lastModified || app.createdAt || null; const formattedDate = lastModified ? new Date(lastModified).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', }) : null; const handleInstall = () => { window.location.href = deepLinkUrl; setTimeout(() => onClose(), 500); }; return ( {/* Close button outside modal */} {/* Header */} {/* App row */} {/* Emoji */} {emoji} {/* Info */} {/* Title */} {appName} {/* Meta row */} {author && ( {author.charAt(0).toUpperCase()} {author} )} {isOfficial && ( } label="Official" size="small" sx={{ height: 24, bgcolor: 'rgba(255, 149, 0, 0.1)', color: '#FF9500', fontWeight: 600, fontSize: 11, '& .MuiChip-icon': { color: '#FF9500', ml: 0.5 }, '& .MuiChip-label': { px: 1 }, }} /> )} {/* Stats row */} {likes} {formattedDate && ( Updated {formattedDate} )} {/* Description - intégrée au bloc info */} {description} {/* Divider */} {/* Desktop App Requirement Block */} {/* All platforms: Normal install flow */} Reachy Mini Desktop App required No robot? Try it in simulation mode – no hardware needed! Download the desktop app → {/* Linux Beta Notice */} {isLinux && ( Linux support is currently in Beta — please report any issues on{' '} GitHub {' '}or{' '} Discord. )} {/* Actions */} ); } export default InstallModal;