Add Notification and new mini desing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { X, Save } from 'lucide-react';
|
||||
|
||||
export default function FileEditorModal({ file, onClose, onSave }) {
|
||||
export default function FileEditorModal({ file, onClose, onSave, theme }) {
|
||||
const [content, setContent] = useState(file.content);
|
||||
const [saving, setSaving] = useState(false);
|
||||
|
||||
@@ -25,37 +25,37 @@ export default function FileEditorModal({ file, onClose, onSave }) {
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
||||
<div className="bg-gray-800 rounded-lg w-full max-w-4xl h-[80vh] flex flex-col">
|
||||
<div className="flex items-center justify-between p-4 border-b border-gray-700">
|
||||
<h2 className="text-xl font-bold">Редактирование: {file.name}</h2>
|
||||
<div className={`${theme.secondary} rounded-lg w-full max-w-4xl h-[80vh] flex flex-col ${theme.border} border`}>
|
||||
<div className={`flex items-center justify-between p-4 ${theme.border} border-b`}>
|
||||
<h2 className={`text-xl font-bold ${theme.text}`}>Редактирование: {file.name}</h2>
|
||||
<div className="flex gap-2">
|
||||
<button
|
||||
onClick={handleSave}
|
||||
disabled={saving}
|
||||
className="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded flex items-center gap-2 disabled:opacity-50"
|
||||
className="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded flex items-center gap-2 disabled:opacity-50 text-white transition"
|
||||
>
|
||||
<Save className="w-4 h-4" />
|
||||
{saving ? 'Сохранение...' : 'Сохранить'}
|
||||
</button>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="text-gray-400 hover:text-white"
|
||||
className={`${theme.textSecondary} hover:${theme.text} transition`}
|
||||
>
|
||||
<X className="w-6 h-6" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 overflow-hidden p-4 bg-gray-900">
|
||||
<div className={`flex-1 overflow-hidden p-4 ${theme.console || theme.primary}`}>
|
||||
<textarea
|
||||
value={content}
|
||||
onChange={(e) => setContent(e.target.value)}
|
||||
className="w-full h-full bg-black text-gray-300 font-mono text-sm p-4 rounded border border-gray-700 focus:outline-none focus:border-blue-500 resize-none"
|
||||
className={`w-full h-full ${theme.console || theme.primary} ${theme.consoleText || theme.text} font-mono text-sm p-4 rounded ${theme.border} border focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none`}
|
||||
spellCheck={false}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="p-4 border-t border-gray-700 text-sm text-gray-400">
|
||||
<div className={`p-4 ${theme.border} border-t text-sm ${theme.textSecondary}`}>
|
||||
Используйте Ctrl+S для быстрого сохранения
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user