Added a condition in the "IconColumn" class

This commit is contained in:
David
2025-03-18 02:24:12 -04:00
parent 25c6b316bd
commit 6319343a76

View File

@@ -4,10 +4,7 @@ namespace App\Tables\Extensions;
use Closure;
use Mmt\GenericTable\Attributes\MappedRoute;
use Mmt\GenericTable\Components\Column;
use Mmt\GenericTable\Enums\ColumnSettingFlags;
use Mmt\GenericTable\Interfaces\IColumn;
use Mmt\GenericTable\Interfaces\IColumnFormatter;
use Mmt\GenericTable\Interfaces\IColumnRenderer;
use Str;
@@ -15,8 +12,6 @@ class IconColumn implements IColumn, IColumnRenderer
{
public int $settings = 0;
public string $bindedRoute = '';
public ?MappedRoute $mappedRoute = null;
public ?string $databaseColumnName = 'status';
@@ -33,6 +28,8 @@ class IconColumn implements IColumn, IColumnRenderer
public function renderCell(\Illuminate\Database\Eloquent\Model $rowModel): string
{
$icon = 'bi bi-arrow-up-right-circle-fill';
if(isset($this->setIconCallback))
$icon = $this->setIconCallback->call($this, $rowModel);
return <<<HTML