Files
WebFTP/components/ConnectionHelpModal.tsx
backuppc c485f411b3 ..
2026-01-19 11:40:55 +09:00

75 lines
3.8 KiB
TypeScript

import React from 'react';
import { ShieldAlert, ExternalLink, X, AlertTriangle } from 'lucide-react';
interface ConnectionHelpModalProps {
isOpen: boolean;
onClose: () => void;
}
const ConnectionHelpModal: React.FC<ConnectionHelpModalProps> = ({ isOpen, onClose }) => {
if (!isOpen) return null;
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4">
<div className="bg-white rounded-lg shadow-2xl max-w-lg w-full overflow-hidden border border-red-100">
{/* Header */}
<div className="bg-red-50 p-4 border-b border-red-100 flex items-center justify-between">
<div className="flex items-center gap-2 text-red-700">
<ShieldAlert size={20} />
<h2 className="font-bold text-lg"> </h2>
</div>
<button onClick={onClose} className="text-red-400 hover:text-red-600 transition-colors">
<X size={20} />
</button>
</div>
{/* Content */}
<div className="p-6 space-y-4">
<p className="text-slate-700 text-sm leading-relaxed">
<strong>HTTPS()</strong> <strong> (ws://localhost)</strong>로 접속을 시도하고 있습니다.
(Mixed Content) .
</p>
<div className="bg-yellow-50 border border-yellow-200 rounded-lg p-4 space-y-2">
<h3 className="font-semibold text-yellow-800 flex items-center gap-2 text-sm">
<AlertTriangle size={16} />
(Chrome/Edge)
</h3>
<ol className="list-decimal list-inside text-xs text-yellow-800 space-y-1.5 ml-1">
<li>
:
<div className="bg-white border border-yellow-300 rounded px-2 py-1 mt-1 font-mono text-slate-600 select-all cursor-pointer hover:bg-slate-50" onClick={(e) => navigator.clipboard.writeText(e.currentTarget.textContent || '')}>
chrome://flags/#allow-insecure-localhost
</div>
</li>
<li>
<strong>Allow invalid certificates for resources from localhost</strong> <span className="font-bold text-green-600">Enabled</span> .
</li>
<li>
<strong>Relaunch</strong> .
</li>
</ol>
</div>
<p className="text-xs text-slate-500 text-center">
.
</p>
</div>
{/* Footer */}
<div className="p-4 bg-slate-50 border-t border-slate-200 flex justify-end">
<button
onClick={onClose}
className="px-4 py-2 bg-white hover:bg-slate-100 text-slate-700 border border-slate-300 rounded text-sm transition-colors font-medium shadow-sm"
>
</button>
</div>
</div>
</div>
);
};
export default ConnectionHelpModal;