<?php

declare(strict_types=1);

namespace apexl\Io\modules\formbuilder\Components\FormKitField;

readonly class DropzoneFormKitField extends FormKitField
{
    protected final const string TYPE = 'dropzone';

    public function setFileSavePath(string $url): static
    {
        return $this->setProperty('fileSavePath', $url);
    }

    /**
     * Fully-qualified URL the FE Dropzone uses to render a thumbnail of the
     * existing file when the field has a value at mount. When set together
     * with a populated field value, the FE swaps the empty drop-zone for a
     * pre-populated card (counted toward maxFiles, removable to upload anew).
     * When not set, no preview is shown.
     */
    public function setFilePreviewUrl(string $url): static
    {
        return $this->setProperty('filePreviewUrl', $url);
    }
}
