<?php

declare(strict_types=1);


namespace App\Filament\Resources\Comments\Schemas;

use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Textarea;
use Filament\Schemas\Schema;

class CommentForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('author_name')
                    ->label('作者')
                    ->required(),
                TextInput::make('author_email')
                    ->label('邮箱'),
                TextInput::make('author_url')
                    ->label('网站')
                    ->url(),
                Textarea::make('content')
                    ->label('内容')
                    ->required()
                    ->rows(5),
                Select::make('status')
                    ->label('状态')
                    ->options([
                        'published' => '已发布',
                        'pending' => '待审核',
                        'spam' => '垃圾',
                        'rejected' => '已拒绝',
                    ])
                    ->required(),
            ]);
    }
}
