UNPKG

@assistant-ui/react

Version:

React components for AI chat.

1 lines 926 B
{"version":3,"sources":["../../../src/primitives/threadList/ThreadListNew.ts"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useAssistantRuntime } from \"../../context\";\n\nconst useThreadListNew = () => {\n const runtime = useAssistantRuntime();\n return () => {\n runtime.switchToNewThread();\n };\n};\n\nexport namespace ThreadListPrimitiveNew {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadListNew>;\n}\n\nexport const ThreadListPrimitiveNew = createActionButton(\n \"ThreadListPrimitive.New\",\n useThreadListNew,\n);\n"],"mappings":";;;AAEA;AAAA,EAGE;AAAA,OACK;AACP,SAAS,2BAA2B;AAEpC,IAAM,mBAAmB,MAAM;AAC7B,QAAM,UAAU,oBAAoB;AACpC,SAAO,MAAM;AACX,YAAQ,kBAAkB;AAAA,EAC5B;AACF;AAOO,IAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AACF;","names":[]}