{"version":3,"sources":["../src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx"],"sourcesContent":["import { DocumentPointer } from \"@vn-sdk/react-core\";\nimport { Label } from \"../../ui/label\";\nimport React from \"react\";\nimport Chip from \"@mui/material/Chip/Chip.js\";\nimport Avatar from \"@mui/material/Avatar/Avatar.js\";\n\nexport interface IncludedFilesPreviewProps {\n  includedFiles: DocumentPointer[];\n  setIncludedFiles: React.Dispatch<React.SetStateAction<DocumentPointer[]>>;\n}\n\nexport const IncludedFilesPreview = ({\n  includedFiles,\n  setIncludedFiles,\n}: IncludedFilesPreviewProps) => {\n  return (\n    <div className=\"flex flex-col gap-2 mt-2\">\n      <Label className=\"\">Included context:</Label>\n      <div className=\"flex flex-wrap gap-2\">\n        {includedFiles.map((filePointer, index) => {\n          return (\n            <FileChipPreview\n              key={`file-${filePointer.sourceApplication}.${filePointer.name}`}\n              filePointer={filePointer}\n              onDelete={() => {\n                setIncludedFiles((prev) => prev.filter((fp) => fp !== filePointer));\n              }}\n            />\n          );\n        })}\n      </div>\n    </div>\n  );\n};\n\nexport interface FileChipPreviewProps {\n  filePointer: DocumentPointer;\n  onDelete: () => void;\n}\n\nexport const FileChipPreview = ({ filePointer, onDelete }: FileChipPreviewProps) => {\n  return (\n    <Chip\n      label={filePointer.name}\n      onDelete={onDelete}\n      avatar={\n        <Avatar\n          src={filePointer.iconImageUri}\n          alt={filePointer.sourceApplication}\n          sx={{ backgroundColor: \"transparent\" }}\n        ></Avatar>\n      }\n    />\n  );\n};\n"],"mappings":";;;;;AAGA,OAAO,UAAU;AACjB,OAAO,YAAY;AAYf,SACE,KADF;AALG,IAAM,uBAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AACF,MAAiC;AAC/B,SACE,qBAAC,SAAI,WAAU,4BACb;AAAA,wBAAC,SAAM,WAAU,IAAG,+BAAiB;AAAA,IACrC,oBAAC,SAAI,WAAU,wBACZ,wBAAc,IAAI,CAAC,aAAa,UAAU;AACzC,aACE;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA,UAAU,MAAM;AACd,6BAAiB,CAAC,SAAS,KAAK,OAAO,CAAC,OAAO,OAAO,WAAW,CAAC;AAAA,UACpE;AAAA;AAAA,QAJK,QAAQ,YAAY,qBAAqB,YAAY;AAAA,MAK5D;AAAA,IAEJ,CAAC,GACH;AAAA,KACF;AAEJ;AAOO,IAAM,kBAAkB,CAAC,EAAE,aAAa,SAAS,MAA4B;AAClF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,YAAY;AAAA,MACnB;AAAA,MACA,QACE;AAAA,QAAC;AAAA;AAAA,UACC,KAAK,YAAY;AAAA,UACjB,KAAK,YAAY;AAAA,UACjB,IAAI,EAAE,iBAAiB,cAAc;AAAA;AAAA,MACtC;AAAA;AAAA,EAEL;AAEJ;","names":[]}