Skip to content

Commit

Permalink
fix: introduced toggle buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramkanakam87 committed Aug 28, 2024
1 parent d67dd04 commit 583e295
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions app/Filament/Dashboard/Resources/ReportResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Components\ToggleButtons;
use Filament\Forms\Form;
use Filament\Forms\Get;
use Filament\Resources\Resource;
Expand All @@ -37,15 +38,24 @@ public static function form(Form $form): Form
{
return $form
->schema([
Toggle::make('is_change')
ToggleButtons::make('is_change')
->label('')
->live()
->label(function ($state) {
if ($state == true) {
return 'Request changes to data';
} else {
return 'Report false data';
}
}),
->default(false)
->options([
true => 'Request Changes to Data',
false => 'Report Synthetic Compound(s)',
])
->inline(),
// Toggle::make('is_change')
// ->live()
// ->label(function ($state) {
// if ($state == true) {
// return 'Request Changes to Data';
// } else {
// return 'Report Synthetic Compound(s)';
// }
// }),
Select::make('report_type')
->label('Choose')
->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Select what you want to report. Ex: Molecule, Citation, Collection, Organism.')
Expand Down

0 comments on commit 583e295

Please sign in to comment.