@@ -35,17 +35,17 @@ const getIconFromString = (iconString: string | React.ReactNode): React.ReactNod
3535
3636const truncateDescription = ( description : string , maxLength : number = 180 ) : string => {
3737 if ( ! description ) return '' ;
38-
38+
3939 if ( description . length <= maxLength ) {
4040 return description ;
4141 }
42-
42+
4343
4444 const truncated = description . substring ( 0 , maxLength ) ;
4545 const lastSpaceIndex = truncated . lastIndexOf ( ' ' ) ;
46-
46+
4747 const cutPoint = lastSpaceIndex > maxLength - 20 ? lastSpaceIndex : maxLength ;
48-
48+
4949 return description . substring ( 0 , cutPoint ) + '...' ;
5050} ;
5151
@@ -57,8 +57,8 @@ interface ExtendedQuickTask extends QuickTask {
5757const HomeInput : React . FC < HomeInputProps > = ( {
5858 selectedTeam,
5959} ) => {
60- const [ submitting , setSubmitting ] = useState ( false ) ;
61- const [ input , setInput ] = useState ( "" ) ;
60+ const [ submitting , setSubmitting ] = useState < boolean > ( false ) ;
61+ const [ input , setInput ] = useState < string > ( "" ) ;
6262 const [ raiError , setRAIError ] = useState < RAIErrorData | null > ( null ) ;
6363
6464 const textareaRef = useRef < HTMLTextAreaElement > ( null ) ;
@@ -129,10 +129,10 @@ const HomeInput: React.FC<HomeInputProps> = ({
129129 errorDetail = error ?. response ?. data ?. detail ;
130130 }
131131
132- // Handle RAI validation errors - just show description as toast
132+ // Handle RAI validation errors - just show description as toast
133133 if ( errorDetail ?. error_type === 'RAI_VALIDATION_FAILED' ) {
134- const description = errorDetail . description ||
135- "Your request contains content that doesn't meet our safety guidelines. Please try rephrasing." ;
134+ const description = errorDetail . description ||
135+ "Your request contains content that doesn't meet our safety guidelines. Please try rephrasing." ;
136136 showToast ( description , "error" ) ;
137137 } else {
138138 // Handle other errors with toast messages
@@ -141,7 +141,7 @@ const HomeInput: React.FC<HomeInputProps> = ({
141141 error ?. response ?. data ?. message ||
142142 error ?. message ||
143143 "Something went wrong. Please try again." ;
144-
144+
145145 showToast ( errorMessage , "error" ) ;
146146 }
147147 } finally {
@@ -242,18 +242,18 @@ const HomeInput: React.FC<HomeInputProps> = ({
242242
243243 < div className = "home-input-quick-tasks" >
244244 < div >
245- { tasksToDisplay . map ( ( task ) => (
246- < PromptCard
247- key = { task . id }
248- title = { task . title }
249- icon = { task . icon }
250- description = { task . description }
251- onClick = { ( ) => handleQuickTaskClick ( task ) }
252- disabled = { submitting }
253-
254- />
255- ) ) }
256- </ div >
245+ { tasksToDisplay . map ( ( task ) => (
246+ < PromptCard
247+ key = { task . id }
248+ title = { task . title }
249+ icon = { task . icon }
250+ description = { task . description }
251+ onClick = { ( ) => handleQuickTaskClick ( task ) }
252+ disabled = { submitting }
253+
254+ />
255+ ) ) }
256+ </ div >
257257 </ div >
258258 </ >
259259 ) }
0 commit comments