import React, { useState } from 'react'; import Button from './Button'; import { APP_NAME } from '../constants'; // For title interface ConstantsEditorPageProps { initialConstantsContent: string; onLogout: () => void; onSave?: (newContent: string) => void; // Optional: if we want to handle save in App.tsx } const ConstantsEditorPage: React.FC = ({ initialConstantsContent, onLogout, }) => { const [content, setContent] = useState(initialConstantsContent); const [isSaved, setIsSaved] = useState(false); const handleDownload = () => { const blob = new Blob([content], { type: 'text/typescript;charset=utf-8;' }); const link = document.createElement('a'); link.href = URL.createObjectURL(blob); link.setAttribute('download', 'constants.ts'); document.body.appendChild(link); link.click(); document.body.removeChild(link); URL.revokeObjectURL(link.href); setIsSaved(true); setTimeout(() => setIsSaved(false), 3000); // Reset saved message }; return (

Редактор constants.ts для {APP_NAME}