<?php

namespace App\Orchid\Layouts\Promocode;

use Orchid\Screen\Layouts\Rows;
use Orchid\Screen\Fields\Input;
use Orchid\Screen\Fields\DateTimer;

class PromocodeEditLayout extends Rows {

  protected $title;

  protected function fields(): iterable {
    return [
      Input::make('promocode.code')
        ->type('text')
        ->title('Code')
        ->placeholder('Enter code'),

      Input::make('promocode.discount')
        ->type('number')
        ->title('Discount')
        ->placeholder('Enter discount in %'),

      DateTimer::make('promocode.expires_at')
        ->title('Expires at')
        ->format('Y-m-d')
    ];
  }
}
