react-filerobot-video-editor
Version:
React component version of filerobot video editor (FVE).
1 lines • 1.33 kB
JavaScript
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import React from"react";import{useFinetune}from"../../../hooks";import restrictNumber from"../../../utils/restrictNumber";import{Warmth as CustomWarmth}from"../../../custom/finetunes";import Slider from"../../common/Slider";import{StyledSliderContainer,StyledSliderInput,StyledSliderLabel,StyledSliderWrapper}from"../tools.styled";var MIN_VALUE=0,DEFAULT_VALUE={warmth:0},MAX_VALUE=200,sliderStyle={width:150,padding:0,margin:0},WarmthOptions=function(a){var b,c,d=a.t,e=useFinetune(CustomWarmth,DEFAULT_VALUE),f=_slicedToArray(e,2),g=f[0],h=f[1],i=function(a){h({warmth:restrictNumber(a,MIN_VALUE,MAX_VALUE)})};return React.createElement(StyledSliderContainer,{className:"FIE_warmth-option-wrapper"},React.createElement(StyledSliderLabel,{className:"FIE_warmth-option-label"},d("warmthTool")),React.createElement(StyledSliderWrapper,null,React.createElement(Slider,{className:"FIE_warmth-option",min:MIN_VALUE,max:MAX_VALUE,width:"124px",value:null!==(b=g.warmth)&&void 0!==b?b:DEFAULT_VALUE.warmth,onChange:i,style:sliderStyle}),React.createElement(StyledSliderInput,{"data-testid":"FIE-warmth-option-input",value:null!==(c=g.warmth)&&void 0!==c?c:DEFAULT_VALUE.warmth,onChange:function(a){var b=a.target.value;return i(b)}})))};export default WarmthOptions;