{"version":3,"file":"AISuggestions.mjs","names":[],"sources":["../../../../../src/plugins/AIComponents/Suggestions/AISuggestions.tsx"],"sourcesContent":["import React from 'react';\nimport clsx from 'clsx';\n\nimport { useTranslationContext } from '../../../context/TranslationContext';\nimport { ThemeScopeProvider, useAIThemeScopeClassName } from '../themeScope';\n\nexport type AISuggestionsProps = {\n  /** Called with the suggestion the person picked, such as to send it. */\n  onSelect: (suggestion: string) => void;\n  /** Starters for a conversation, such as \"What's on my calendar today?\". */\n  suggestions: string[];\n  className?: string;\n};\n\n/**\n * A row of starter chips for an empty conversation. Picking one hands its text to\n * `onSelect`. The counterpart of `SuggestionsView`.\n */\nexport const AISuggestions = ({\n  className,\n  onSelect,\n  suggestions,\n}: AISuggestionsProps) => {\n  const themeScopeClassName = useAIThemeScopeClassName();\n  const { t } = useTranslationContext();\n  if (suggestions.length === 0) return null;\n  return (\n    <ThemeScopeProvider>\n      <div\n        aria-label={t('aiComponents.suggestions.suggestions.ariaLabel', 'Suggestions')}\n        className={clsx(themeScopeClassName, 'str-chat__ai-suggestions', className)}\n        role='group'\n      >\n        {suggestions.map((suggestion) => (\n          <button\n            className='str-chat__ai-suggestions__item'\n            key={suggestion}\n            onClick={() => onSelect(suggestion)}\n            type='button'\n          >\n            {suggestion}\n          </button>\n        ))}\n      </div>\n    </ThemeScopeProvider>\n  );\n};\n"],"mappings":";;;;;;;;;;;AAkBA,IAAa,iBAAiB,EAC5B,WACA,UACA,kBACwB;CACxB,MAAM,sBAAsB,yBAAyB;CACrD,MAAM,EAAE,MAAM,sBAAsB;CACpC,IAAI,YAAY,WAAW,GAAG,OAAO;CACrC,OACE,oBAAC,oBAAD,EAAA,UACE,oBAAC,OAAD;EACE,cAAY,EAAE,kDAAkD,aAAa;EAC7E,WAAW,KAAK,qBAAqB,4BAA4B,SAAS;EAC1E,MAAK;YAEJ,YAAY,KAAK,eAChB,oBAAC,UAAD;GACE,WAAU;GAEV,eAAe,SAAS,UAAU;GAClC,MAAK;aAEJ;EACK,GALD,UAKC,CACT;CACE,CAAA,EACa,CAAA;AAExB"}