import React, { useState } from 'react'; import styled from '@emotion/styled'; import CheckIcon from '@mui/icons-material/Check'; import DoNotDisturbIcon from '@mui/icons-material/DoNotDisturb'; import KeyboardArrowLeftIcon from '@mui/icons-material/KeyboardArrowLeft'; import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'; const CenterButton = styled('div')` display: flex; justify-content: center; align-items: center; width: 30px; height: 30px; border: 1px solid black; border-radius: 5px; margin: 5px; cursor: ${({ buttonEnabled }) => (buttonEnabled ? 'pointer' : 'not-allowed')}; transition: background-color 0.3s ease, color 0.3s ease; opacity: ${({ buttonEnabled }) => (buttonEnabled ? 1 : 0.5)}; ${({ color, buttonEnabled }) => buttonEnabled && color && ` &:hover { background-color: ${color}; color: white; } `} `; export const TransferBox = ({ fields, leftGroup, rightGroup }) => { const { id, exclusionList, oldListLabel, newListLabel } = fields; const [itemSelected, setItemSelected] = useState({}); const [containsSelection, setContainsSelection] = useState([]); return (

{oldListLabel}

{leftGroup?.map((j, index) => { return (
{j?.value}
) })}
{ console.log('clicked Right') }} color='#A8A8A8' buttonEnabled={itemSelected?.id} > { console.log('clicked Clear') }} color='#FF6666' buttonEnabled={containsSelection?.length > 0} > { console.log('clicked Save') }} color='#00B33C' buttonEnabled={containsSelection?.length > 0} > { console.log('clicked Left') }} color='#A8A8A8' buttonEnabled={itemSelected?.id} >

{newListLabel}

{rightGroup?.map((j, index) => { return (
{j?.value}
) })}
); }