<?php

namespace App\Filament\Resources\Projects\Schemas;

use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Schema;

class ProjectInfolist
{
    public static function configure(Schema $schema): Schema
    {
        return $schema->components([
            TextEntry::make('name')->label(__('admin.project')),
            TextEntry::make('domain')->label(__('admin.domain')),
            TextEntry::make('url')->label(__('admin.root_url'))->url(fn ($record) => $record->url)->openUrlInNewTab(),
            TextEntry::make('user.name')->label(__('admin.customer')),
            TextEntry::make('user.email')->label(__('admin.email')),
            TextEntry::make('status')->label(__('admin.status'))->badge()->formatStateUsing(fn ($state) => $state->label()),
            TextEntry::make('ulid')->label(__('admin.project_id')),
            TextEntry::make('created_at')->label(__('admin.created_at'))->dateTime('d.m.Y H:i'),
            TextEntry::make('updated_at')->label(__('admin.updated_at'))->dateTime('d.m.Y H:i'),
        ]);
    }
}
