ThemeToggle::render()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Xetaravel\View\Components;
6
7
use Closure;
8
use Illuminate\Contracts\View\View;
9
use Illuminate\View\Component;
10
11
class ThemeToggle extends Component
12
{
13
    public string $uuid;
14
15
    public function __construct(
16
        public ?string $id = null,
17
        public ?string $value = null,
18
        public ?string $light = "Light",
19
        public ?string $dark = "Dark",
20
        public ?string $lightTheme = "light",
21
        public ?string $darkTheme = "dark",
22
        public ?string $lightClass = "light",
23
        public ?string $darkClass = "dark",
24
        public ?bool $withLabel = false,
25
    ) {
26
        $this->uuid = md5(serialize($this)) . $id;
27
    }
28
29
    /**
30
     * Get the view / contents that represent the component.
31
     */
32
    public function render(): View|Closure|string
33
    {
34
        return view('components.theme-toggle');
35
    }
36
}
37