react-filerobot-video-editor
Version:
React component version of filerobot video editor (FVE).
1 lines • 1.35 kB
JavaScript
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onBack","backLabel"];import React from"react";import{Button}from"@scaleflex/ui/core";import ArrowLeftOutline from"@scaleflex/icons/arrow-left-outline";import styled from"styled-components";import{FontVariant as FV}from"@scaleflex/ui/utils/types/typography";import{usePhoneScreen,useStore}from"../../hooks";import{DiscardConfirmationModal}from"../common/ConfirmationModals";import{CLOSING_REASONS}from"../../utils/constants";var StyledBackButtonLabel=styled.span.withConfig({componentId:"sc-85bm9w-0"})(["",";"],function(a){var b=a.theme.typography;return b.font[FV.ButtonMdEmphasis]}),BackButton=function(a){var b=a.onBack,c=a.backLabel,d=_objectWithoutProperties(a,_excluded),e=useStore(),f=e.t,g=e.config,h=g.onBack,i=g.onClose,j=usePhoneScreen(),k=b||h||i;return"function"==typeof k?React.createElement(DiscardConfirmationModal,{onDiscard:k,discardReason:CLOSING_REASONS.BACK_BUTTON},React.createElement(Button,_extends({className:"FIE_buttons-back-btn","data-testid":"FIE_buttons-back-btn",color:"link-secondary",size:"sm",startIcon:React.createElement(ArrowLeftOutline,null),onClick:k},d),!j&&React.createElement(StyledBackButtonLabel,null,c||f("back")))):null};export default BackButton;