@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
2 lines (1 loc) • 1.58 kB
JavaScript
import{jsxs as e,jsx as a}from"react/jsx-runtime";import o from"@mui/material/Typography";import i from"@mui/material/Dialog";import r from"@mui/material/DialogTitle";import t from"@mui/material/DialogActions";import n from"@mui/material/Button";import m from"@mui/material/useMediaQuery";import{useTheme as l}from"@mui/material/styles";import{ImageUpload as p}from"./Upload/ImageUpload.container.js";import{ImageCrop as c}from"./Crop/ImageCrop.container.js";import{dialogStyles as s}from"./ImageCropDialog.styles.js";const d=({cropperRef:d,currentPage:g,onBack:u,onNext:f,imageUploadTitle:h,imageCropTitle:C,initialImage:y,currentImage:b,onImageUploaded:v,cropShape:x,cropDimensions:I,onCancel:S,onSave:U,onClose:D,sx:j,t:k,...R})=>{const T="upload"===g,A=b?"string"==typeof b?b:b instanceof File?URL.createObjectURL(b):y:y,N=l(),B=m(N.breakpoints.down("sm"));return e(i,{...R,fullScreen:B,sx:[s,...Array.isArray(j)?j:[j]],children:[a(r,{component:o,variant:"h6",fontWeight:"700",children:T?h||k("Update part thumbnail"):C||k("Edit selected image")}),T&&a(p,{currentImage:A,onImageChange:v,t:k}),!T&&a(c,{cropperRef:d,imageSrc:"string"==typeof A?A:void 0,onCancel:S,onSave:U,cropShape:x,cropDimensions:I,t:k}),e(t,{children:[a(n,{"aria-label":k("Cancel"),onClick:u,"data-testid":"image-crop-dialog-back-button",children:k(T?"Cancel":"Previous")}),a(n,{variant:"contained","aria-label":k(T?"Next":"Save"),disabled:!("string"==typeof A||A instanceof File)||""===A,onClick:f,"data-testid":"image-crop-dialog-next-button",children:k(T?"Next":"Save")})]})]})};export{d as default};