<?php
$iName = $segment->segmentTemplate->internal_name;

// if omega system segment - no only read mode
$isOmegaSystemSegment = (strpos($iName, 'omega_') === 0 && substr($iName, -7) === '_system') && $iName !== 'omega_objective_system';
$isOmegaHistorySegment = strpos($iName, 'omega_history_') === 0;
?>

<div class="border-bottom note-section visit-segment {{$isOmegaSystemSegment || $note->is_signed_by_hcp ? '' : 'edit-trigger'}}"
     data-segment-uid="{{ $segment->uid }}"
     data-segment-template-uid="{{ $segment->segmentTemplate->uid }}"
     data-segment-template-name="{{ $segment->segmentTemplate->internal_name }}">

    <div class="d-flex align-items-start bg-light text-dark {{$segment->heading ? 'p-1' : 'py-1 pr-1'}}">

    <!-- title -->

            <?php
            $extraClass = $segment->heading ? 'min-width-110px max-width-110px' : 'min-width-140px pl-2';
            ?>

            @if(!!$segment->display_title)
            <div class="text-dark font-weight-bold font-size-13 mr-2 {{$extraClass}} {{!$segment->is_active ? 'opacity-35' : ''}}">
                @if($segment->display_title == 'Free Text')

                @else
                    {{$segment->display_title}}:
                @endif
            </div>
            @endif

            <div class="flex-grow-1">
                @if($segment->is_active)
                    <div class="d-none if-not-edit inset-comment summary-container">
                        @if($note->is_signed_by_hcp && $segment->accepted_suggestion_summary_html)
                            {!! $segment->accepted_suggestion_summary_html !!}
                        @else
                            {!! $segment->summary_html !!}
                        @endif
                    </div>

                    <?php if($iName !== 'ros' && $iName !== 'omega_ros' && !$isOmegaHistorySegment) { ?>
                    <div class="d-none if-edit edit-container">
                        {!! $segment->edit_html !!}
                    </div>
                    <?php } ?>
                @else
                    <span class="text-warning-dark">Deactivated</span>
                @endif
            </div>

    </div>




</div>
