"use client"; import { LIMITS } from "@/lib/limits"; interface ImageUrlInputProps { value: string[]; onChange: (urls: string[]) => void; } export function ImageUrlInput({ value, onChange }: ImageUrlInputProps) { const urls = value.length > 0 ? value : [""]; const max = LIMITS.MAX_IMAGE_URLS; function addField() { if (urls.length < max) { onChange([...urls, ""]); } } function removeField(index: number) { const next = urls.filter((_, i) => i !== index); onChange(next.length > 0 ? next : [""]); } function updateField(index: number, next: string) { const updated = [...urls]; updated[index] = next; onChange(updated); } return (
Upload foto ke hosting (imgur, imgbb, dll) lalu paste URL-nya di sini.