<?php

namespace App\Filament\Tables;

use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;

class ExternalDataTable extends Table
{
    protected Collection $records;

    public function setRecords(Collection $records): static
    {
        $this->records = $records;

        return $this;
    }

    public function getRecords(): Collection
    {
        return $this->records ?? new Collection();
    }

    public function getTotalRecords(): ?int
    {
        return $this->getRecords()->count();
    }
}
