import React from 'react'
import Button from './Button'
import { COLORS, DEFAULT_PRESETS } from '../lib/constants'
import * as Arrows from './svg/Arrows'
import Remove from './svg/Remove'
const removeButtonStyles = {
position: 'absolute',
top: '6px',
right: '6px',
width: '11px',
height: '11px',
borderRadius: '999px',
}
const Preset = React.memo(({ remove, apply, selected, preset }) => {
const isSelected = preset.id === selected
return (
)
})
const arrowButtonStyle = {
position: 'absolute',
top: 0,
right: '16px',
height: '100%',
}
const Presets = React.memo(
({ show, create, toggle, undo, presets, selected, remove, apply, applied, contentRef }) => {
const customPresetsLength = presets.length - DEFAULT_PRESETS.length
const disabledCreate = selected != null
return (
Presets
{show && (
create +
)}
{show ? : }
{show && (
{presets
.filter(p => p.custom)
.map(preset => (
))}
{customPresetsLength > 0 ?
: null}
{presets
.filter(p => !p.custom)
.map(preset => (
))}
)}
{show && applied && (
Preset applied!
undo ↩
)}
)
}
)
export default Presets