diff --git a/frontend/src/components/common/AccordionList/AccordionList.interface.ts b/frontend/src/components/common/AccordionList/AccordionList.interface.ts index f95b7b7e..288c7e5f 100644 --- a/frontend/src/components/common/AccordionList/AccordionList.interface.ts +++ b/frontend/src/components/common/AccordionList/AccordionList.interface.ts @@ -8,4 +8,5 @@ export interface AccordionListProps { export interface AccordionListItemProps { title: string; + noContentTooltipText: string; } diff --git a/frontend/src/components/common/AccordionList/AccordionList.tsx b/frontend/src/components/common/AccordionList/AccordionList.tsx index 006a3e5a..7fd692ae 100644 --- a/frontend/src/components/common/AccordionList/AccordionList.tsx +++ b/frontend/src/components/common/AccordionList/AccordionList.tsx @@ -6,7 +6,7 @@ export const AccordionList = ({ items }: PropsWithChildren) return (
{items.map(({ title, children, key }) => ( - + {children} ))} diff --git a/frontend/src/components/common/AccordionList/AccordionListItem.tsx b/frontend/src/components/common/AccordionList/AccordionListItem.tsx index bc4c0246..af176a33 100644 --- a/frontend/src/components/common/AccordionList/AccordionListItem.tsx +++ b/frontend/src/components/common/AccordionList/AccordionListItem.tsx @@ -2,9 +2,19 @@ import { PropsWithChildren, useState } from 'react'; import { ChevronRightIcon } from '@app/static/icons/ChevronRightIcon'; import { generateClassNames } from '@app/utils'; import { AccordionListItemProps } from './AccordionList.interface'; +import { Tooltip } from '@app/components/common/Tooltip'; -export const AccordionListItem = ({ title, children }: PropsWithChildren) => { +export const AccordionListItem = ({ + title, + noContentTooltipText, + children, +}: PropsWithChildren) => { const [isOpen, setOpen] = useState(false); + const disableExpand = !children; + + const handleClick = () => { + setOpen((prevState) => !prevState); + }; return (
@@ -12,18 +22,20 @@ export const AccordionListItem = ({ title, children }: PropsWithChildren setOpen(!isOpen)} + onClick={disableExpand ? undefined : handleClick} > {title} -
- {children ? ( - - ) : undefined} -
+ +
+ +
+
{children ? ( -
+
{children}
) : undefined}