remove individual popover components

This commit is contained in:
Jennifer Player
2023-09-15 14:36:36 -04:00
parent 7bf7c16a5d
commit 45d5ab20ec
60 changed files with 117 additions and 584 deletions

View File

@ -15,11 +15,11 @@ import {
import { ReactNode } from 'react';
import { useAppSelector } from '../../app/store/storeHooks';
import { systemSelector } from '../../features/system/store/systemSelectors';
import { useTranslation } from 'react-i18next';
interface Props extends PopoverProps {
heading?: string;
paragraph: string;
triggerComponent: ReactNode;
details: string;
children: ReactNode;
image?: string;
buttonLabel?: string;
buttonHref?: string;
@ -27,18 +27,21 @@ interface Props extends PopoverProps {
}
function IAIInformationalPopover({
heading,
paragraph,
details,
image,
buttonLabel,
buttonHref,
triggerComponent,
children,
placement,
}: Props) {
const { shouldDisableInformationalPopovers } = useAppSelector(systemSelector);
const { t } = useTranslation();
const heading = t(`popovers.${details}.heading`);
const paragraph = t(`popovers.${details}.paragraph`);
if (shouldDisableInformationalPopovers) {
return triggerComponent;
return children;
} else {
return (
<Popover
@ -48,7 +51,7 @@ function IAIInformationalPopover({
variant="informational"
>
<PopoverTrigger>
<div>{triggerComponent}</div>
<div>{children}</div>
</PopoverTrigger>
<PopoverContent>
<PopoverArrow />