title: $:/plugins/linonetwo/tw-calendar/calendar-widget/tiddlywiki-ui/popup/EventPreview/TopButtons

\define lingo-base() $:/plugins/linonetwo/tw-calendar/language/

<div class="tw-calendar-layout-event-preview-top-buttons">
  <$button to=<<currentTiddler>> style="flex: 4;" class="tw-calendar-layout-event-preview-close-button">
    <<lingo Button/OpenInStory/Caption>> {{$:/core/images/standard-layout}}
  </$button>
  <% if [{$:/layout}match[$:/plugins/linonetwo/tw-calendar/tiddlywiki-ui/PageLayout/EventsCalendarSearchLayout]] %>
    <$button style="flex: 4;" class="tw-calendar-layout-event-preview-close-button">
      <<lingo Button/OpenInDay/Caption>> {{$:/plugins/linonetwo/tw-calendar/tiddlywiki-ui/Images/EventCalendar}}
      <!-- Use this to set initial value for calendar widget in the EventsCalendarLayout -->
      <$action-createtiddler
        $basetitle="$:/state/Calendar/PageLayout/EventCalendar/initialParams"
        $overwrite="yes"
        initialView="timeGridDay"
        initialDate=<<twCalendarOccurrenceStartDate>>
      >
      <!-- After initial value is set, switch to the layout and let it use initial values -->
        <$action-setfield $tiddler="$:/layout" text="$:/plugins/linonetwo/tw-calendar/tiddlywiki-ui/PageLayout/EventsCalendarLayout" />
      </$action-createtiddler>
    </$button>
  <% endif %>
  <$button style="flex: 1;" class="tw-calendar-layout-event-preview-close-button" >
    {{$:/core/images/close-button}}
  </$button>
</div>
