feat(clipping): add title requirement check
All checks were successful
CI / Maven unit tests (push) Successful in 14s
CI / Build and push images (push) Successful in 48s
CI / Deploy to server (push) Successful in 8s

This commit is contained in:
2026-08-19 18:34:11 +01:00
parent 9e82dc8574
commit 9033261165
2 changed files with 11 additions and 2 deletions

View File

@@ -9,9 +9,12 @@ type Props = {
const MetadataBox = ({ setMetadata, className }: Props) => (
<div className={clsx("flex flex-col content-between p-6 gap-2", className)}>
<p className="w-full font-body text-text-strong font-bold text-sm">Title</p>
<p className="w-full font-body text-text-strong font-bold text-sm">
Title <span className="text-error">*</span>
</p>
<input
type="text"
required
placeholder="Enter title"
onChange={(e) => setMetadata(prev => ({ ...prev, title: e.target.value }))}
className="border border-hairline bg-fields rounded-md w-full p-2 text-sm focus:outline-none focus:ring-2 focus:ring-muted transition-colors"

View File

@@ -64,12 +64,18 @@ const ClipEdit = () => {
const sendData = async () => {
if (!localFile || uploading) return;
const title = outputMetadata.title.trim();
if (!title) {
setError('A title is required before exporting.');
return;
}
setUploading(true);
setError(null);
let jobId: string;
try {
jobId = await compress(localFile, outputMetadata);
jobId = await compress(localFile, { ...outputMetadata, title });
setUploadedId(jobId);
} catch (err: unknown) {
setError(`Failed to start compression: ${err instanceof Error ? err.message : 'Unknown error'}`);