diff --git a/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/cversions.2.db b/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/cversions.2.db new file mode 100644 index 0000000..ae2b3d1 Binary files /dev/null and b/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/cversions.2.db differ diff --git a/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/{4819D7AC-741E-4EB8-9922-4572D3973EAB}.2.ver0x0000000000000001.db b/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/{4819D7AC-741E-4EB8-9922-4572D3973EAB}.2.ver0x0000000000000001.db new file mode 100644 index 0000000..63ee37b Binary files /dev/null and b/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/{4819D7AC-741E-4EB8-9922-4572D3973EAB}.2.ver0x0000000000000001.db differ diff --git a/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/{6AF0698E-D558-4F6E-9B3C-3716689AF493}.2.ver0x0000000000000001.db b/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/{6AF0698E-D558-4F6E-9B3C-3716689AF493}.2.ver0x0000000000000001.db new file mode 100644 index 0000000..e72b8c3 Binary files /dev/null and b/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/{6AF0698E-D558-4F6E-9B3C-3716689AF493}.2.ver0x0000000000000001.db differ diff --git a/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/{DDF571F2-BE98-426D-8288-1A9A39C3FDA2}.2.ver0x0000000000000001.db b/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/{DDF571F2-BE98-426D-8288-1A9A39C3FDA2}.2.ver0x0000000000000001.db new file mode 100644 index 0000000..ef8dbb4 Binary files /dev/null and b/packages/molecules/%SystemDrive%/ProgramData/Microsoft/Windows/Caches/{DDF571F2-BE98-426D-8288-1A9A39C3FDA2}.2.ver0x0000000000000001.db differ diff --git a/packages/molecules/src/accordian-card/index.tsx b/packages/molecules/src/accordian-card/index.tsx index d5439ed..6e1fcb4 100644 --- a/packages/molecules/src/accordian-card/index.tsx +++ b/packages/molecules/src/accordian-card/index.tsx @@ -10,6 +10,7 @@ import { Typography, } from '@mui/material'; import { ExpandMore } from '@mui/icons-material'; + export interface CardProps { key: string | number; bgcolor: string; @@ -35,6 +36,7 @@ const AccordionCard: React.FC = ({ buttonText, buttonVariant, buttonStyle, + onButtonClick, onClick, icon, isAccordion = false, @@ -42,6 +44,22 @@ const AccordionCard: React.FC = ({ }) => { const [expanded, setExpanded] = useState(false); + const handleAccordionClick = (e: React.MouseEvent) => { + if (onClick) { + onClick(e); + } + if (isAccordion) { + setExpanded(!expanded); + } + }; + + const handleButtonClick = (e: React.MouseEvent) => { + e.stopPropagation(); + if (onButtonClick) { + onButtonClick(); + } + }; + return ( = ({ backgroundColor: bgcolor, border: 'none !important', }} - onClick={onClick} + onClick={handleAccordionClick} > = ({ variant={buttonVariant} size="large" sx={buttonStyle} - onClick={(e) => { - e.stopPropagation(); - // onButtonClick(); - }} + onClick={handleButtonClick} > {buttonText} @@ -108,7 +123,6 @@ const AccordionCard: React.FC = ({ color="#fff" fontWeight={600} fontSize={'13px'} - onClick={() => setExpanded(!expanded)} display="flex" justifyContent="center" alignItems="center" @@ -140,4 +154,4 @@ const AccordionCard: React.FC = ({ ); }; -export { AccordionCard }; +export default AccordionCard; diff --git a/packages/molecules/src/dynamic-card/index.tsx b/packages/molecules/src/dynamic-card/index.tsx index 148fc50..bcb3823 100644 --- a/packages/molecules/src/dynamic-card/index.tsx +++ b/packages/molecules/src/dynamic-card/index.tsx @@ -1,4 +1,4 @@ -import { ExpandMore } from '@mui/icons-material'; +import { Download, ExpandMore } from '@mui/icons-material'; import { Accordion, AccordionDetails, @@ -9,7 +9,8 @@ import { Typography, } from '@mui/material'; import React from 'react'; -import { AccordionCard } from '../accordian-card'; +import AccordionCard from '../accordian-card'; + type OuterAccordion = { title: string; date: string; @@ -33,10 +34,69 @@ interface CardProps { type Props = { outerAccordion: OuterAccordion; results: CardProps[]; - InfoCard?: (props: CardProps) => React.ReactNode; }; -const DynamicCard = React.memo(({ outerAccordion, results, InfoCard }: Props) => { +const DynamicCard = React.memo(({ outerAccordion, results }: Props) => { + + // Declare InfoCard inside DynamicCard + const InfoCard = ({ result }: { result: any }) => { + + // Function to determine the color based on the score/value + const getColor = (value: number) => (value === 0 ? "red" : value === 1 ? "green" : "grey"); + + // Render the transcript or result depending on the available data + const renderContent = () => { + if (result?.result && result.result.length > 0) { + return result.result.map((qa: any, index: number) => ( + + + Q: {qa.question} + + + A: {qa.answer} + + + )); + } + + if (result?.transcript && result?.transcript?.length > 0) { + return ( +

+ {result.transcript.map((item: any, index: number) => { + const word = Object.keys(item)[0]; + const value = item[word]; + return ( + + {word}{' '} + + ); + })} +

+ ); + } + + return

No transcript or result available

; + }; + + return ( + + + {result?.title?.sub_label || "सब्दों की सुचि"} + + +
+ + {renderContent()} + +
+ ); + }; + return ( outerAccordion.title === 'निपुण' ? 'var(--successSecondary)' : 'var(--failureSecondary)', + color: outerAccordion.title === 'निपुण' ? 'var(--success)' : 'var(--failure)', border: 'none', maxHeight: '64px', }} > - + {outerAccordion.title} - + आकलन : {outerAccordion.date} @@ -80,22 +141,22 @@ const DynamicCard = React.memo(({ outerAccordion, results, InfoCard }: Props) => : () => <>} + InfoCard={() => } isAccordion /> );