<?php

namespace App\Helpers\Equipment\Part;

use App\Models\Equipment\Part\DomainModel;

class DomainHelper extends PartHelper
{
    public function __construct()
    {
        parent::__construct();
        $this->setTitleField(field: DomainModel::TITLE);
    }

    public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
    {
        switch ($field) {
            case 'domain':
                $form = form_input($field, $value ?? "", ['id' => $field, "placeholder" => "예)domain.co.kr", ...$extras]);
                $form .= "<div id=\"domain-errors\" style=\"color:red; margin-top:5px;\"></div>";
                break;
            default:
                $form = parent::getFieldForm($field, $value, $viewDatas, $extras);
                break;
        }
        return $form;
    } //
}
