use Scalar::Util qw(blessed);
use SL::Layout::ActionBar::Action;
use SL::Layout::ActionBar::ComboBox;
+use SL::Layout::ActionBar::Link;
use SL::Layout::ActionBar::Separator;
use constant HTML_CLASS => 'layout-actionbar';
my %class_descriptors = (
action => { class => 'SL::Layout::ActionBar::Action', num_params => 1, },
combobox => { class => 'SL::Layout::ActionBar::ComboBox', num_params => 1, },
+ link => { class => 'SL::Layout::ActionBar::Link', num_params => 1, },
separator => { class => 'SL::Layout::ActionBar::Separator', num_params => 0, },
);
--- /dev/null
+package SL::Layout::ActionBar::Link;
+
+use strict;
+use parent qw(SL::Layout::ActionBar::Action);
+
+sub from_params {
+ my ($class, $data) = @_;
+
+ my ($text, %params) = @$data;
+ return SL::Layout::ActionBar::Link->new(text => $text, params => \%params);
+}
+
+sub render {
+ my ($self) = @_;
+
+ return $self->p->html_tag(
+ 'a', $self->text,
+ %{ $self->params // {} },
+ id => $self->id,
+ class => 'layout-actionbar-link',
+ );
+}
+
+1;