<?php

namespace App\Admin;

use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Symfony\Component\Form\Extension\Core\Type\TextType;

final class FeedbackAdmin extends AbstractAdmin
{
    protected function configureFormFields(FormMapper $form): void
    {
        $form->add('name', TextType::class)
        ->add('phone', TextType::class);
    }

    protected function configureDatagridFilters(DatagridMapper $datagrid): void
    {
        $datagrid->add('name')
        ->add('phone')
        ->add('message');
    }

    protected function configureListFields(ListMapper $list): void
    {
        $list->addIdentifier('id')
        ->add('name')
        ->add('phone')
        ->add('message');
    }

    protected function configureShowFields(ShowMapper $show): void
    {
        $show->add('name')
        ->add('phone')
        ->add('message');
    }
}