ConusAI vendor 81941888f

This commit is contained in:
ConusAI vendor 81941888f
2026-10-07 08:47:51 +00:00
commit c3c6526952
135 changed files with 13010 additions and 0 deletions
@@ -0,0 +1,24 @@
import { fileRepository } from '@/entities/file'
import { DeleteFileButton } from '@/features/delete-file'
import { UploadFileForm } from '@/features/upload-file'
import { db } from '@/shared/api'
/** The attachments on one note, with the controls to add and remove them. */
export async function Attachments({ noteId }: { noteId: string }) {
const attached = await fileRepository(db()).listByNote(noteId)
return (
<section>
<h3>Attachments</h3>
{attached.length === 0 ? <p>No attachments yet.</p> : null}
<ul>
{attached.map((file) => (
<li key={file.id}>
<a href={file.url}>{file.name}</a> ({file.size} bytes)
<DeleteFileButton id={file.id} />
</li>
))}
</ul>
<UploadFileForm noteId={noteId} />
</section>
)
}