diff --git a/apps/web/src/components/ui/inputs/BusterInput/BusterInput.tsx b/apps/web/src/components/ui/inputs/BusterInput/BusterInput.tsx index f5bd3dd58..ee7367214 100644 --- a/apps/web/src/components/ui/inputs/BusterInput/BusterInput.tsx +++ b/apps/web/src/components/ui/inputs/BusterInput/BusterInput.tsx @@ -22,6 +22,8 @@ export const BusterInput = ({ variant = 'default', onChange, ariaLabel = 'Buster Input', + readOnly, + autoFocus, //suggestions suggestionItems, closeSuggestionOnSelect = true, @@ -58,6 +60,7 @@ export const BusterInput = ({ console.warn('Item is loading', params); return; } + console.log('onSelectItem', addValueToInput, params); if (addValueToInput) setValue(inputValue ?? String(label)); onClick?.(); if (closeSuggestionOnSelect) setHasClickedSelect(true); @@ -92,13 +95,13 @@ export const BusterInput = ({ variant={variant} > = { onChange?: (value: string) => void; submitting?: boolean; disabled?: boolean; + readOnly?: boolean; onSubmit: (value: string) => void; onStop: () => void; variant?: 'default'; + autoFocus?: boolean; sendIcon?: React.ReactNode; secondaryActions?: React.ReactNode; placeholder?: string; @@ -67,7 +69,7 @@ export type BusterInputProps = { emptyComponent?: React.ReactNode | string | false; //if false, no empty component will be shown //mentions onMentionItemClick?: (params: MentionTriggerItem) => void; - mentions?: MentionSuggestionExtension[]; + mentions: MentionSuggestionExtension[]; //suggestions suggestionItems: ( | BusterInputDropdownItem diff --git a/apps/web/src/components/ui/inputs/BusterInput/BusterMentionsInput.tsx b/apps/web/src/components/ui/inputs/BusterInput/BusterMentionsInput.tsx index de471470d..7a60485e1 100644 --- a/apps/web/src/components/ui/inputs/BusterInput/BusterMentionsInput.tsx +++ b/apps/web/src/components/ui/inputs/BusterInput/BusterMentionsInput.tsx @@ -1,7 +1,7 @@ /** biome-ignore-all lint/complexity/noUselessFragments: Intersting bug when NOT using fragments */ import { Command } from 'cmdk'; import React from 'react'; -import { cn } from '@/lib/classMerge'; +import { MentionInput, type MentionInputProps } from '../MentionInput'; import type { BusterInputProps } from './BusterInput.types'; export type BusterMentionsInputProps = Pick< @@ -14,33 +14,29 @@ export type BusterMentionsInputProps = Pick< | 'filter' | 'onMentionItemClick' > & { - onChangeInputValue: (value: string) => void; -} & React.ComponentPropsWithoutRef; + onChange: MentionInputProps['onChange']; + className?: string; + style?: React.CSSProperties; + autoFocus?: boolean; + readOnly?: boolean; +}; export const BusterMentionsInput = ({ - children, value: valueProp, placeholder, defaultValue, mentions, value, - onChangeInputValue, - className, - style, ...props }: BusterMentionsInputProps) => { return ( -