package details import ( "context" "fmt" "strconv" "github.com/starfleetcptn/gomft/components" "github.com/starfleetcptn/gomft/components/file_metadata" "github.com/starfleetcptn/gomft/components/file_metadata/dialog" // Import dialog package "github.com/starfleetcptn/gomft/components/file_metadata/utils" // Import utils package ) // FileMetadataDetails renders the details view for a file metadata, matching original structure templ FileMetadataDetails(ctx context.Context, data file_metadata.FileMetadataDetailsData) { @components.LayoutWithContext("File Details", ctx) {
@utils.FileMetadataJS() // Include JS for toasts, etc.

File Details: { data.File.FileName }

Back to Files
{ data.File.FileName }

File ID: { strconv.FormatUint(uint64(data.File.ID), 10) }

File Information
Filename { data.File.FileName }
Size { utils.FormatFileSize(data.File.FileSize) }
Hash if data.File.FileHash != "" { { data.File.FileHash } } else { Not available }
Status { data.File.Status }
Original Path
{ data.File.OriginalPath }
Destination Path
{ data.File.DestinationPath }
Processing Information
if data.File.Status == "error" && data.File.ErrorMessage != "" { }
Job { data.File.Job.Name }
Processed Time
{ data.File.ProcessedTime.Format("2006-01-02 15:04:05") }
Creation Time
{ data.File.CreationTime.Format("2006-01-02 15:04:05") }
Modification Time
{ data.File.ModTime.Format("2006-01-02 15:04:05") }
Error
{ data.File.ErrorMessage }
Record Created { data.File.CreatedAt.Format("2006-01-02 15:04:05") }
Record Updated { data.File.UpdatedAt.Format("2006-01-02 15:04:05") }
@dialog.FileMetadataDialog( fmt.Sprintf("delete-file-dialog-%d", data.File.ID), "Delete File Metadata", fmt.Sprintf("Are you sure you want to delete the metadata for '%s'? This cannot be undone.", data.File.FileName), "text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-red-600 dark:hover:bg-red-700 focus:outline-none dark:focus:ring-red-800", // Use correct classes "Delete", "delete", data.File.ID, data.File.FileName, "details", // Indicate this is from the details view )
Back to Files
} }