Skip to content

Commit

Permalink
use canWrap trait
Browse files Browse the repository at this point in the history
  • Loading branch information
a7medKhalid committed Jan 9, 2024
1 parent d4b5391 commit 7ce88e5
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/Tables/PopoverColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Filament\Support\Concerns;
use Filament\Tables\Columns\Column;
use Filament\Tables\Columns\Concerns\CanWrap;
use Filament\Tables\Columns\Concerns\HasDescription;
use LaraZeus\Popover\Concerns\HasPopover;

Expand All @@ -12,27 +13,14 @@ class PopoverColumn extends Column
use Concerns\HasIcon;
use HasPopover;
use HasDescription;
use CanWrap;

protected string $view = 'zeus-popover::popover';

protected bool | Closure $canWrap = false;

protected function setUp(): void
{
parent::setUp();

$this->disabledClick();
}

public function wrap(bool | Closure $condition = true): static
{
$this->canWrap = $condition;

return $this;
}

public function canWrap(): bool
{
return (bool) $this->evaluate($this->canWrap);
}
}

0 comments on commit 7ce88e5

Please sign in to comment.