<?php

namespace App\Filament\Resources\Users\Schemas;

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

class UserInfolist
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                Section::make(__('admin.users.sections.account'))
                    ->columns(3)
                    ->schema([
                        TextEntry::make('id')
                            ->label(__('admin.users.fields.id'))
                            ->copyable(),
                        TextEntry::make('name')
                            ->label(__('admin.users.fields.name')),
                        TextEntry::make('email')
                            ->label(__('admin.users.fields.email'))
                            ->copyable(),
                        TextEntry::make('role')
                            ->label(__('admin.users.fields.role'))
                            ->badge(),
                        TextEntry::make('email_verified_at')
                            ->label(__('admin.users.fields.email_verified_at'))
                            ->dateTime()
                            ->placeholder(__('admin.users.placeholders.not_verified')),
                        TextEntry::make('account_verified_at')
                            ->label(__('admin.users.fields.account_verified_at'))
                            ->dateTime()
                            ->placeholder(__('admin.users.placeholders.not_verified')),
                        TextEntry::make('suspended_at')
                            ->label(__('admin.users.fields.suspended_at'))
                            ->dateTime()
                            ->placeholder(__('admin.users.placeholders.not_suspended')),
                        TextEntry::make('suspendedBy.name')
                            ->label(__('admin.users.fields.suspended_by'))
                            ->placeholder(__('admin.users.placeholders.empty')),
                        ImageEntry::make('avatar_url')
                            ->label(__('admin.users.fields.avatar'))
                            ->circular()
                            ->placeholder(__('admin.users.placeholders.empty')),
                    ]),
                Section::make(__('admin.users.sections.profile'))
                    ->columns(3)
                    ->schema([
                        TextEntry::make('bio')
                            ->label(__('admin.users.fields.bio'))
                            ->placeholder(__('admin.users.placeholders.empty'))
                            ->columnSpanFull(),
                        TextEntry::make('height')
                            ->label(__('admin.users.fields.height'))
                            ->numeric(decimalPlaces: 0)
                            ->suffix(' cm')
                            ->placeholder(__('admin.users.placeholders.empty')),
                        TextEntry::make('date_of_birth')
                            ->label(__('admin.users.fields.date_of_birth'))
                            ->date()
                            ->placeholder(__('admin.users.placeholders.empty')),
                        TextEntry::make('sex')
                            ->label(__('admin.users.fields.sex'))
                            ->badge(),
                    ]),
                Section::make(__('admin.users.sections.nutrition_goals'))
                    ->columns(4)
                    ->schema([
                        TextEntry::make('daily_calorie_goal')
                            ->label(__('admin.users.fields.daily_calorie_goal'))
                            ->numeric(decimalPlaces: 0)
                            ->suffix(' kcal'),
                        TextEntry::make('daily_protein_goal')
                            ->label(__('admin.users.fields.daily_protein_goal'))
                            ->numeric(maxDecimalPlaces: 2)
                            ->suffix(' g'),
                        TextEntry::make('daily_carbs_goal')
                            ->label(__('admin.users.fields.daily_carbs_goal'))
                            ->numeric(maxDecimalPlaces: 2)
                            ->suffix(' g'),
                        TextEntry::make('daily_fats_goal')
                            ->label(__('admin.users.fields.daily_fats_goal'))
                            ->numeric(maxDecimalPlaces: 2)
                            ->suffix(' g'),
                    ]),
                Section::make(__('admin.users.sections.activity'))
                    ->columns(3)
                    ->schema([
                        TextEntry::make('physical_activity_level')
                            ->label(__('admin.users.fields.physical_activity_level'))
                            ->badge(),
                        TextEntry::make('weight_goal')
                            ->label(__('admin.users.fields.weight_goal'))
                            ->badge(),
                        TextEntry::make('pace_preference')
                            ->label(__('admin.users.fields.pace_preference'))
                            ->badge(),
                    ]),
                Section::make(__('admin.users.sections.metadata'))
                    ->columns(2)
                    ->schema([
                        TextEntry::make('created_at')
                            ->label(__('admin.users.fields.created_at'))
                            ->dateTime()
                            ->placeholder(__('admin.users.placeholders.empty')),
                        TextEntry::make('updated_at')
                            ->label(__('admin.users.fields.updated_at'))
                            ->dateTime()
                            ->placeholder(__('admin.users.placeholders.empty')),
                    ]),
            ]);
    }
}
