<?php

declare(strict_types=1);


namespace App\Filament\Resources\Users\Schemas;

use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class UserForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('name')
                    ->label('昵称')
                    ->required(),
                TextInput::make('email')
                    ->label('邮箱')
                    ->email()
                    ->required(),
                TextInput::make('password')
                    ->label('密码（留空不修改）')
                    ->password()
                    ->dehydrated(false),
                DateTimePicker::make('email_verified_at')
                    ->label('邮箱验证时间'),
                TextInput::make('url')
                    ->label('主页')
                    ->url(),
                TextInput::make('loginip')
                    ->label('最近登录 IP')
                    ->disabled(),
                TextInput::make('regip')
                    ->label('注册 IP')
                    ->disabled(),
                DateTimePicker::make('logintime')
                    ->label('最近登录时间')
                    ->disabled(),
                TextInput::make('logincount')
                    ->label('登录次数')
                    ->numeric()
                    ->disabled(),
            ]);
    }
}
