Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "wordpress-plugins/real-cookie-banner/src/public/ts/components/config/cookies/groups/tabHeadline"

Index

Variables

Const CookieGroupTabHeadline

CookieGroupTabHeadline: FC<{ group: CookieGroupModel }> = observer(({ group }) => {const {optionStore: {others: {hints: { deleteCookieGroup }}},cookieStore: { essentialGroup }} = useStores();const { path, isExact } = useRouteMatch();const {busy,data: { id, name, description }} = group;const [isEditVisible, setIsEditVisible] = useState(false);const isActiveTab = useRouteCookieGroup().group.key === group.key;const isEssential = id === essentialGroup.key;const history = useHistory();const handleDelete = useCallback(async () => {await group.delete({force: true});history.replace(path.replace(":cookieGroup?", essentialGroup.key.toString()));}, [group, history, essentialGroup, isActiveTab, path]);return (<Spin spinning={busy}><Tooltip title={description} placement="bottomLeft"><span>{name}</span></Tooltip>{isActiveTab && isExact ? (<Popovervisible={isEditVisible}arrowPointAtCentercontent={<CookieGroupEditForm edit={group} onClose={() => setIsEditVisible(false)} />}placement="bottomLeft"><EditOutlined onClick={() => setIsEditVisible(true)} style={{ margin: 0, marginLeft: 5 }} /></Popover>) : null}{isActiveTab && isExact ? (isEssential ? (<Tooltipplacement="bottomLeft"arrowPointAtCenteroverlay={__(`The "%s" service group cannot be deleted.`, name)}><CloseOutlined style={{ margin: 0, marginLeft: 5, color: "#d2d2d2" }} /></Tooltip>) : (<Popconfirmtitle={reactNl2Br([__("Are you sure you want to delete this service group? All services within this group will also be deleted. Consider moving them before you delete the service group."),...deleteCookieGroup].join("\n\n"))}placement="bottom"onConfirm={handleDelete}okText={__("Delete")}cancelText={__("Cancel")}overlayStyle={{ maxWidth: 350 }}onVisibleChange={() => setIsEditVisible(false)}><CloseOutlined style={{ margin: 0, marginLeft: 5 }} /></Popconfirm>)) : null}</Spin>);})

Generated using TypeDoc