export type ExpiryPreset = "7-days" | "30-days" | "1-year" | "never" | "keep"; export function presetToExpiresAt(preset: ExpiryPreset, now: Date): string | null | undefined { if (preset === "keep") return undefined; if (preset === "never") return null; const days = preset === "7-days" ? 7 : preset === "30-days" ? 30 : 365; // The server accepts UTC timestamps at whole-second precision. return new Date(now.getTime() + days * 86_400_000).toISOString().replace(/\.\d{3}Z$/, "Z"); } export function ExpiryPresets({ id, value, onChange, keepCurrent = false }: { id: string; value: ExpiryPreset; onChange: (preset: ExpiryPreset) => void; keepCurrent?: boolean; }) { return (
); }