import { Box, Input, Tooltip } from '@wix/design-system';
import { FlagSmall, PinSmall, StatusAlertSmall, } from '@wix/wix-ui-icons-common';
import React from 'react';
import { observer } from 'mobx-react-lite';
import { useWixPatternsContainer } from '../..';
import { VIEWS_REDESIGN_EXPERIMENT } from './ViewsDropdown';
export function _ViewsDropdownPrefix(props) {
    const { state } = props;
    const container = useWixPatternsContainer();
    const isRedesign = container.internalExperiments?.enabled(VIEWS_REDESIGN_EXPERIMENT);
    const { views } = state;
    const { collection: { translate: t }, } = views;
    if (!views.isCurrentViewSelected ||
        (views.isCurrentViewSelected && state.isViewChanged)) {
        return (React.createElement(Input.Affix, null,
            React.createElement(Box, { dataHook: "view-pending-changes" },
                React.createElement(Tooltip, { appendTo: "window", content: views.isCurrentViewSelected
                        ? t('cairo.manageView.tooltip')
                        : t('cairo.manageView.unsaved.tooltip') },
                    React.createElement(Box, { verticalAlign: "middle", color: "D40" },
                        React.createElement(StatusAlertSmall, null))))));
    }
    if (views.isDefaultView) {
        const DefaultIcon = isRedesign ? PinSmall : FlagSmall;
        return (React.createElement(Input.Affix, null,
            React.createElement(Box, { dataHook: "view-default" },
                React.createElement(DefaultIcon, null))));
    }
    return null;
}
export const ViewsDropdownPrefix = observer(_ViewsDropdownPrefix);
//# sourceMappingURL=ViewsDropdownPrefix.js.map