UNPKG

@assistant-ui/react

Version:

Typescript/React library for AI Chat

1 lines 880 B
{"version":3,"sources":["../../../src/primitives/contentPart/ContentPartInProgress.tsx"],"sourcesContent":["\"use client\";\n\nimport { FC, PropsWithChildren } from \"react\";\nimport { useContentPart } from \"../../context\";\n\nexport namespace ContentPartPrimitiveInProgress {\n export type Props = PropsWithChildren;\n}\n\n// TODO should this be renamed to IsRunning?\nexport const ContentPartPrimitiveInProgress: FC<\n ContentPartPrimitiveInProgress.Props\n> = ({ children }) => {\n const isInProgress = useContentPart((c) => c.status.type === \"running\");\n\n return isInProgress ? children : null;\n};\n\nContentPartPrimitiveInProgress.displayName = \"ContentPartPrimitive.InProgress\";\n"],"mappings":";;;AAGA,SAAS,sBAAsB;AAOxB,IAAM,iCAET,CAAC,EAAE,SAAS,MAAM;AACpB,QAAM,eAAe,eAAe,CAAC,MAAM,EAAE,OAAO,SAAS,SAAS;AAEtE,SAAO,eAAe,WAAW;AACnC;AAEA,+BAA+B,cAAc;","names":[]}