import { defaultSelectionWrapperClassName } from '../constants/constants' import { PopoverChildrentype } from '../types' const DefaultPopover: PopoverChildrentype = ({ selection, removeSelection, updateSelection, disableMultiColorHighlight, handleCopy, identifier, }) => { const handleDelete = () => { removeSelection(selection, identifier) } const changeColor = (colorClassName: string) => { const classes = selection.className || defaultSelectionWrapperClassName const classArr = classes.split(' ') const colorIndex = classArr.findIndex((item: any) => item.startsWith('bg-')) if (colorIndex !== -1) { classArr.splice(colorIndex, 1) } classArr.push(colorClassName) updateSelection( selection.id, { ...selection, className: classArr.join(' '), }, identifier, ) } console.log(selection, 'copy selection_____') return (
{selection.text.length} characters selected