chore(react/type_widget): fix missing tbody

This commit is contained in:
Elian Doran 2025-09-19 22:18:10 +03:00
parent d83ff641d7
commit 034073a5e1
No known key found for this signature in database

View File

@ -18,58 +18,60 @@ export default function FilePropertiesTab({ note }: { note?: FNote | null }) {
<div className="file-properties-widget"> <div className="file-properties-widget">
{note && ( {note && (
<table class="file-table"> <table class="file-table">
<tr> <tbody>
<th class="text-nowrap">{t("file_properties.note_id")}:</th> <tr>
<td class="file-note-id">{note.noteId}</td> <th class="text-nowrap">{t("file_properties.note_id")}:</th>
<th class="text-nowrap">{t("file_properties.original_file_name")}:</th> <td class="file-note-id">{note.noteId}</td>
<td class="file-filename">{originalFileName ?? "?"}</td> <th class="text-nowrap">{t("file_properties.original_file_name")}:</th>
</tr> <td class="file-filename">{originalFileName ?? "?"}</td>
<tr> </tr>
<th class="text-nowrap">{t("file_properties.file_type")}:</th> <tr>
<td class="file-filetype">{note.mime}</td> <th class="text-nowrap">{t("file_properties.file_type")}:</th>
<th class="text-nowrap">{t("file_properties.file_size")}:</th> <td class="file-filetype">{note.mime}</td>
<td class="file-filesize">{formatSize(blob?.contentLength ?? 0)}</td> <th class="text-nowrap">{t("file_properties.file_size")}:</th>
</tr> <td class="file-filesize">{formatSize(blob?.contentLength ?? 0)}</td>
</tr>
<tr> <tr>
<td colSpan={4}> <td colSpan={4}>
<div class="file-buttons"> <div class="file-buttons">
<Button <Button
icon="bx bx-download" icon="bx bx-download"
text={t("file_properties.download")} text={t("file_properties.download")}
primary primary
disabled={!canAccessProtectedNote} disabled={!canAccessProtectedNote}
onClick={() => downloadFileNote(note.noteId)} onClick={() => downloadFileNote(note.noteId)}
/> />
<Button <Button
icon="bx bx-link-external" icon="bx bx-link-external"
text={t("file_properties.open")} text={t("file_properties.open")}
disabled={note.isProtected} disabled={note.isProtected}
onClick={() => openNoteExternally(note.noteId, note.mime)} onClick={() => openNoteExternally(note.noteId, note.mime)}
/> />
<FormFileUploadButton <FormFileUploadButton
icon="bx bx-folder-open" icon="bx bx-folder-open"
text={t("file_properties.upload_new_revision")} text={t("file_properties.upload_new_revision")}
disabled={!canAccessProtectedNote} disabled={!canAccessProtectedNote}
onChange={(fileToUpload) => { onChange={(fileToUpload) => {
if (!fileToUpload) { if (!fileToUpload) {
return; return;
}
server.upload(`notes/${note.noteId}/file`, fileToUpload[0]).then((result) => {
if (result.uploaded) {
toast.showMessage(t("file_properties.upload_success"));
} else {
toast.showError(t("file_properties.upload_failed"));
} }
});
}} server.upload(`notes/${note.noteId}/file`, fileToUpload[0]).then((result) => {
/> if (result.uploaded) {
</div> toast.showMessage(t("file_properties.upload_success"));
</td> } else {
</tr> toast.showError(t("file_properties.upload_failed"));
}
});
}}
/>
</div>
</td>
</tr>
</tbody>
</table> </table>
)} )}
</div> </div>