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:
@@ -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();
|
||||
};
|
||||
Reference in New Issue
Block a user