import React, { forwardRef, useContext } from "react"; import { ChevronDownIcon } from "@navikt/aksel-icons"; import { cl } from "../utils/helpers"; import { useI18n } from "../utils/i18n/i18n.hooks"; import { ExpansionCardContext } from "./context"; export interface ExpansionCardHeaderProps extends React.HTMLAttributes { children: React.ReactNode; } const ExpansionCardHeader = forwardRef< HTMLDivElement, ExpansionCardHeaderProps >(({ children, className, ...rest }, ref) => { const panelContext = useContext(ExpansionCardContext); const translate = useI18n("global"); if (panelContext === null) { console.error( " has to be used within an ", ); return null; } return (
{children}
); }); export default ExpansionCardHeader;