<?php

namespace App\View\Components;

use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

class SummaryCard extends Component
{
    public string $title;
    public $value;
    public string $icon;
    public string $bg;
    public ?float $rate;
    public ?bool $showTrend;

    public function __construct(
        string $title,
               $value,
        string $icon = 'bx bx-copy-alt',
        string $bg = 'bg-primary-subtle text-primary',
        ?float $rate = null,
        bool $showTrend = false
    ) {
        $this->title = $title;
        $this->value = $value;
        $this->icon = $icon;
        $this->bg = $bg;
        $this->rate = $rate;
        $this->showTrend = $showTrend;
    }

    public function render(): View|Closure|string
    {
        return view('components.summary-card');
    }
}
