components([ Section::make(fn () => CheerfulNotification::getByKey('content.section_title')) ->description(fn () => CheerfulNotification::getByKey('content.section_desc')) ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null) ->schema([ TextInput::make('title') ->label('Judul Konten') ->placeholder('Reels Kerja Sama DPMPTSP') ->autocomplete(false) ->autofocus() ->required() ->maxLength(1000), TextInput::make('link') ->label('Tautan (URL)') ->placeholder('https://www.pwknews.com') ->autocomplete(false) ->nullable() ->maxLength(255) ->url(), Grid::make(2) ->schema([ Select::make('type') ->label('Tipe Konten') ->options(ContentType::options()) ->native(false) ->required() ->in(implode(',', array_column(ContentType::cases(), 'value'))), Select::make('channel') ->label('Kanal') ->options(Channel::options()) ->native(false) ->required() ->in(implode(',', array_column(Channel::cases(), 'value'))), Select::make('social_media') ->label('Media Sosial') ->options(SocialMedia::options()) ->native(false) ->required() ->in(implode(',', array_column(SocialMedia::cases(), 'value'))), DatePicker::make('posting_date') ->label('Tanggal Posting') ->placeholder(fn (): string => now()->translatedFormat('l, d F Y')) ->native(false) ->displayFormat('l, d F Y') ->required(), ]), ])->columnSpan(2), Section::make(fn () => CheerfulNotification::getByKey('content.attachment_title')) ->description(fn () => CheerfulNotification::getByKey('content.attachment_desc')) ->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-folder-open' : null) ->schema([ Select::make('classification_id') ->label('Klasifikasi') ->relationship('classification', 'name', function (Builder $query): Builder { return $query->active(); }) ->native(false) ->preload() ->required(), SpatieMediaLibraryFileUpload::make('image') ->label('Gambar Konten') ->disk(config('filesystems.default')) ->acceptedFileTypes(['image/*']) ->maxSize(1024 * 3) ->collection('content-recpaps') ->customProperties(fn (): array => [ 'feature' => 'content-recaps', 'date' => now()->toDateString(), ]) ->image() ->helperText('Format yang diterima: JPEG, PNG, GIF, WEBP. Ukuran maksimum: 3 MB.') ->required(), ])->columnSpan(1), ]) ->columns(3); } }