import { MinusIcon, AddIcon, ViewOffIcon, ViewIcon } from '@chakra-ui/icons'
import {
Text,
Box,
Button,
Flex,
Menu,
MenuButton,
MenuItem,
MenuList,
Portal,
useDisclosure,
} from '@chakra-ui/react'
import React from 'react'
import { colorList, initialFilter, TagColors } from './config'
import { Collapse } from './Sidebar/Collapse'
import { ColorMenu } from './Tweaks/ColorMenu'
export interface TagMenuProps {
setTagColors: any
tagColors: TagColors
setFilter: any
filter: typeof initialFilter
target: string | null
}
export const TagMenu = (props: TagMenuProps) => {
const { setTagColors, setFilter, filter, tagColors, target } = props
const bl: string[] = filter.tagsBlacklist
const wl: string[] = filter.tagsWhitelist
const blacklist = bl.indexOf(target as string) > -1
const whitelist = wl.indexOf(target as string) > -1
const colors = useDisclosure()
return (
<>
{colorList.map((color: string) => (
setTagColors({
...tagColors,
[target as string]: color,
})
}
bgColor={color}
m={1}
borderRadius="sm"
height={3}
width={3}
>
))}
{!whitelist && (
)}
{!blacklist && (
)}
>
)
}