<?php

namespace App\Livewire\Clients;

use Livewire\Component;

class Form extends Component
{
    public string $name = '';
    public string $shortname = '';
    public ?string $crm_id = null;
    public ?string $contact = null;
    public ?string $description = null;
    public ?string $jira = null;
    public bool $actived = true;
    public ?string $observation = null;

    public function mount($client = null)
    {
        if ($client) {
            $this->name = $client->name ?? '';
            $this->shortname = $client->shortname ?? '';
            $this->crm_id = $client->crm_id ?? null;
            $this->contact = $client->contact ?? null;
            $this->description = $client->description ?? null;
            $this->jira = $client->jira ?? null;
            $this->actived = $client->actived ?? true;
            $this->observation = $client->observation ?? null;
        }
    }

    public function render()
    {
        return view('livewire.clients.form');
    }
}

