Add batch upload configure modal and settings mapping utilities.

Users configure share mode, expiry, and max views before upload; batch summary confirms choices above the queue.
This commit is contained in:
2026-10-22 03:14:02 +02:00
parent 3bb3258686
commit 805665745b
23 changed files with 637 additions and 7 deletions
@@ -0,0 +1,20 @@
import dayjs from 'dayjs';
import type { UploadExpiryPreset } from '@/types/upload/UploadExpiryPreset';
import type { UploadExpiryOffset } from '@/types/upload/UploadExpiryOffset';
const EXPIRY_OFFSET: Record<Exclude<UploadExpiryPreset, 'never'>, UploadExpiryOffset> = {
'1h': { amount: 1, unit: 'hour' },
'24h': { amount: 24, unit: 'hour' },
'7d': { amount: 7, unit: 'day' },
'30d': { amount: 30, unit: 'day' }
};
export const resolveUploadBatchExpiresAt = (preset: UploadExpiryPreset): string | null => {
if (preset === 'never') {
return null;
}
const { amount, unit } = EXPIRY_OFFSET[preset];
return dayjs().add(amount, unit).toISOString();
};