<?php

declare(strict_types=1);

namespace App\Filament\Components\Table;

use App\Models\User;
use Filament\Tables\Columns\TextColumn;

class StartedByTextColumn extends TextColumn
{
    public static function create(): static
    {
        return parent::make('started_by')
            ->formatStateUsing(fn ($state) => User::find($state)?->name ?? $state)
            ->translateLabel()
            ->label('کاربر ثبت کننده')
            ->badge()
            ->color('primary')
            ->sortable()
            ->searchable();
    }
}
