<?php

namespace App\Exports;

use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;

class ConduiteExport implements FromView
{
    protected $class, $cutting, $data;
    public function __construct($class, $cutting, $data)
    {
        $this->class = $class;
        $this->cutting = $cutting;
        $this->data = $data;
    }

    
    public function view(): View
    {
        return view('pages.conduite.downLoad.create', [
            'data' => $this->data,
            'classe' => $this->class,
            'cutting' => $this->cutting
        ]);
    }

    public function columnFormats(): array
    {
        return [
            'A' => NumberFormat::FORMAT_NUMBER,
            'B' => NumberFormat::FORMAT_TEXT,
            'C' => NumberFormat::FORMAT_NUMBER,
            'D' => NumberFormat::FORMAT_NUMBER,
            'E' => NumberFormat::FORMAT_NUMBER,
            'F' => NumberFormat::FORMAT_NUMBER,
            'G' => NumberFormat::FORMAT_NUMBER,
        ];
    }
}
