<?php

declare(strict_types=1);

namespace App\Filament\Components\Table;

use Filament\Tables\Columns\TextColumn;

class RootTextColumn extends TextColumn
{
    public static function create(): static
    {
        return parent::make('root_id')
            ->translateLabel()
            ->sortable()
            ->getStateUsing(function ($record) {
                return $record->root?->title;
            })
            ->toggleable()
            ->toggledHiddenByDefault();
    }
}
