修改了MD渲染样式

main
mula.liu 2025-08-05 11:39:55 +08:00
parent 7f5d16e9fc
commit 8c303df485
3 changed files with 117 additions and 35 deletions

View File

@ -356,6 +356,57 @@
margin: 1rem 0; margin: 1rem 0;
} }
/* Audio Upload Section */
.audio-upload-section {
margin-top: 0.5rem;
}
.show-upload-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.75rem 1.5rem;
background: linear-gradient(135deg, #f59e0b, #d97706);
color: white;
border: none;
border-radius: 8px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
font-size: 0.95rem;
}
.show-upload-btn:hover {
background: linear-gradient(135deg, #d97706, #b45309);
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}
.upload-header {
display: flex;
justify-content: flex-end;
margin-bottom: 0.5rem;
}
.close-upload-btn {
background: #f1f5f9;
border: none;
border-radius: 4px;
padding: 0.5rem;
cursor: pointer;
color: #64748b;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
.close-upload-btn:hover {
background: #e2e8f0;
color: #ef4444;
}
/* File Upload Styles */ /* File Upload Styles */
.file-upload-container { .file-upload-container {
position: relative; position: relative;
@ -513,4 +564,9 @@
font-size: 0.8rem; font-size: 0.8rem;
padding: 0.4rem 0.6rem; padding: 0.4rem 0.6rem;
} }
.show-upload-btn {
padding: 0.6rem 1.2rem;
font-size: 0.9rem;
}
} }

View File

@ -25,6 +25,7 @@ const EditMeeting = ({ user }) => {
const [isUploading, setIsUploading] = useState(false); const [isUploading, setIsUploading] = useState(false);
const [error, setError] = useState(''); const [error, setError] = useState('');
const [meeting, setMeeting] = useState(null); const [meeting, setMeeting] = useState(null);
const [showUploadArea, setShowUploadArea] = useState(false);
useEffect(() => { useEffect(() => {
fetchMeetingData(); fetchMeetingData();
@ -172,6 +173,7 @@ const EditMeeting = ({ user }) => {
} }
setAudioFile(null); setAudioFile(null);
setShowUploadArea(false);
// Reset file input // Reset file input
const fileInput = document.getElementById('audio-file'); const fileInput = document.getElementById('audio-file');
if (fileInput) fileInput.value = ''; if (fileInput) fileInput.value = '';
@ -321,45 +323,69 @@ const EditMeeting = ({ user }) => {
</div> </div>
<div className="form-group"> <div className="form-group">
<label> <div className="audio-upload-section">
<Upload size={18} /> {!showUploadArea ? (
重新上传录音
</label>
<div className="file-upload-container">
<input
type="file"
id="audio-file"
accept="audio/*"
onChange={handleFileChange}
className="file-input"
/>
<label htmlFor="audio-file" className="file-upload-label">
<Plus size={20} />
<span>选择新的音频文件</span>
<small>支持 MP3, WAV, M4A 格式最大100MB</small>
</label>
{audioFile && (
<div className="selected-file">
<span>已选择: {audioFile.name}</span>
<button
type="button"
onClick={() => setAudioFile(null)}
className="remove-file"
>
<X size={16} />
</button>
</div>
)}
{audioFile && (
<button <button
type="button" type="button"
onClick={handleUploadAudio} onClick={() => setShowUploadArea(true)}
className="upload-btn" className="show-upload-btn"
disabled={isUploading}
> >
<Upload size={16} /> <Upload size={16} />
{isUploading ? '上传并分析中...' : '上传并重新分析'} <span>重新上传录音文件</span>
</button> </button>
) : (
<div className="file-upload-container">
<div className="upload-header">
<button
type="button"
onClick={() => {
setShowUploadArea(false);
setAudioFile(null);
// Reset file input
const fileInput = document.getElementById('audio-file');
if (fileInput) fileInput.value = '';
}}
className="close-upload-btn"
>
<X size={16} />
</button>
</div>
<input
type="file"
id="audio-file"
accept="audio/*"
onChange={handleFileChange}
className="file-input"
/>
<label htmlFor="audio-file" className="file-upload-label">
<Plus size={20} />
<span>选择新的音频文件</span>
<small>支持 MP3, WAV, M4A 格式最大100MB</small>
</label>
{audioFile && (
<div className="selected-file">
<span>已选择: {audioFile.name}</span>
<button
type="button"
onClick={() => setAudioFile(null)}
className="remove-file"
>
<X size={16} />
</button>
</div>
)}
{audioFile && (
<button
type="button"
onClick={handleUploadAudio}
className="upload-btn"
disabled={isUploading}
>
<Upload size={16} />
{isUploading ? '上传并分析中...' : '上传并重新分析'}
</button>
)}
</div>
)} )}
</div> </div>
</div> </div>

View File

@ -101,7 +101,7 @@
.summary-content { .summary-content {
line-height: 1.7; line-height: 1.7;
color: #475569; color: #475569;
white-space: pre-wrap; white-space: normal;
} }
/* Markdown content styling */ /* Markdown content styling */