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AC5BH,MAAAC,cAACkC,EAAAA,QAAQC,EAAA,CACPX,IAAK,aAAajC,EAAkBG,GAAciB,QAC9CpB,EAAkBG,OAIpB,C","sources":["webpack://nikon-client/./components/organisms/LensGlossary/LensGlossary.tsx"],"sourcesContent":["import Tag from '@atoms/Tag/Tag';\nimport TagTypesEnum from '@models/enums/TagTypesEnum';\nimport { ILensCard } from '@models/ILensCard';\nimport { IMeta } from '@models/IMeta';\nimport LensCard from '@molecules/LensCard/LensCard';\nimport classNames from 'classnames';\nimport { useRef, useState } from 'react';\n\ninterface Props {\n readonly introduction: string;\n readonly lensGlossaryCards: ILensCard[];\n readonly meta: IMeta;\n}\n\nconst LensGlossary = ({ lensGlossaryCards, introduction, meta }: Props) => {\n const [activeIndex, setActiveIndex] = useState(0);\n const titleRef = useRef(null);\n\n const compareCodes = (a: ILensCard, b: ILensCard) => {\n const codeA = a.code.toLowerCase();\n const codeB = b.code.toLowerCase();\n if (codeA < codeB) {\n return -1;\n }\n if (codeA > codeB) {\n return 1;\n }\n return 0;\n };\n\n return (\n \n
\n
\n \n {introduction}\n \n
\n \n {!!lensGlossaryCards?.length &&\n lensGlossaryCards.sort(compareCodes).map((item, index) => {\n const isActive = index === activeIndex;\n\n return (\n {\n setActiveIndex(index);\n titleRef.current?.scrollIntoView({ behavior: 'smooth' });\n }}\n className={classNames(\n 'flex items-center rounded-md outline outline-2 hover:border-white hover:outline-yellow focus:border-white focus:outline-yellow xl:border xl:p-5',\n isActive\n ? 'border-white outline-yellow'\n : 'border-grey outline-white'\n )}\n key={`lens-${item.code}`}\n data-testid={`CT-37-Lens-Glossary-Tab-${index}`}\n >\n \n \n {item.title}\n \n \n );\n })}\n
\n
\n \n
\n \n \n );\n};\n\nexport default LensGlossary;\n"],"names":["_ref","lensGlossaryCards","introduction","meta","activeIndex","setActiveIndex","useState","titleRef","useRef","React","createElement","contentLink","className","editHints","role","length","sort","compareCodes","a","b","codeA","code","toLowerCase","codeB","map","item","index","isActive","type","onClick","current","scrollIntoView","behavior","classNames","key","Tag","span","tagType","TagTypesEnum","Square","text","dataTestId","title","ref","LensCard","_extends"],"sourceRoot":""}