Conditional Pageblock Dependent On Resource

Is there a way to only display a pageblock in a particular resource? I have this for example:

public static function getBlockSchema(): Block
    {
        return Block::make('exit_popup')
            ->label('Exit Popup')
            ->when('resource', 'ComponentResource')
            ->schema([
                TextInput::make('title')
                    ->label('Title')
                    ->required(),

                TextArea::make('intro')
                    ->label('Intro')
                    ->required(),

                TextInput::make('submission_message')
                    ->label('Submission Message')
                    ->required(),

                TextInput::make('button_label')
                    ->label('Button Label')
                    ->required(),
            ]);
    }


I only want this pageblock to be visible within the ComponentResource. Is this possible?
Was this page helpful?