Skip to content

Commit

Permalink
Rename some properties of InputChatContent, TextInputChatContent
Browse files Browse the repository at this point in the history
- hasRegenerate -> canRegenerate
- hasContinue -> canContinue
  • Loading branch information
Yukinobu-Mine committed Aug 13, 2024
1 parent 19089e6 commit 636c9fd
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
24 changes: 12 additions & 12 deletions frontend/src/components/InputChatContent.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import InputChatContent from './InputChatContent';

export const Ideal = () => (
<InputChatContent
hasRegenerate={false}
hasContinue={false}
canRegenerate={false}
canContinue={false}
isLoading={false}
onSend={() => {}}
onRegenerate={() => {}}
Expand All @@ -17,8 +17,8 @@ export const IdealLoading = () => (
disabledSend={true}
disabledRegenerate={true}
disabledContinue={true}
hasRegenerate={false}
hasContinue={false}
canRegenerate={false}
canContinue={false}
isLoading={true}
onSend={() => {}}
onRegenerate={() => {}}
Expand All @@ -30,8 +30,8 @@ export const IdealDisabled = () => {
const { t } = useTranslation();
return (
<InputChatContent
hasRegenerate={false}
hasContinue={false}
canRegenerate={false}
canContinue={false}
isLoading={false}
disabled={true}
placeholder={t('bot.label.notAvailableBotInputMessage')}
Expand All @@ -42,21 +42,21 @@ export const IdealDisabled = () => {
);
};

export const HasRegenerate = () => (
export const WithRegenerate = () => (
<InputChatContent
hasRegenerate={true}
hasContinue={false}
canRegenerate={true}
canContinue={false}
isLoading={false}
onSend={() => {}}
onRegenerate={() => {}}
continueGenerate={() => {}}
/>
);

export const HasContinue = () => (
export const WithContinue = () => (
<InputChatContent
hasRegenerate={true}
hasContinue={true}
canRegenerate={true}
canContinue={true}
isLoading={false}
onSend={() => {}}
onRegenerate={() => {}}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/InputChatContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ type Props = BaseProps & {
disabled?: boolean;
placeholder?: string;
dndMode?: boolean;
hasRegenerate: boolean;
hasContinue: boolean;
canRegenerate: boolean;
canContinue: boolean;
isLoading: boolean;
onSend: (
content: string,
Expand Down Expand Up @@ -535,9 +535,9 @@ const InputChatContent = forwardRef<HTMLElement, Props>((props, focusInputRef) =
))}
</div>
)}
{props.hasRegenerate && (
{props.canRegenerate && (
<div className="absolute -top-14 right-0 flex space-x-2">
{props.hasContinue && !props.disabledContinue && !props.disabled && (
{props.canContinue && !props.disabledContinue && !props.disabled && (
<Button
className="bg-aws-paper p-2 text-sm"
outlined
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/features/agent/components/Agent.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AgentTool } from '../types';

export const InputChatContent = () => (
<TextInputChatContent
hasRegenerate={false}
canRegenerate={false}
isLoading={false}
onSend={() => {}}
onRegenerate={() => {}}
Expand All @@ -18,7 +18,7 @@ export const InputChatContentLoading = () => (
<TextInputChatContent
disabledSend={true}
disabledRegenerate={true}
hasRegenerate={false}
canRegenerate={false}
isLoading={true}
onSend={() => {}}
onRegenerate={() => {}}
Expand All @@ -29,7 +29,7 @@ export const InputChatContentDisabled = () => {
const { t } = useTranslation();
return (
<TextInputChatContent
hasRegenerate={false}
canRegenerate={false}
isLoading={false}
disabled={true}
placeholder={t('bot.label.notAvailableBotInputMessage')}
Expand All @@ -39,9 +39,9 @@ export const InputChatContentDisabled = () => {
);
};

export const InputChatContentHasRegenerate = () => (
export const InputChatContentWithRegenerate = () => (
<TextInputChatContent
hasRegenerate={true}
canRegenerate={true}
isLoading={false}
onSend={() => {}}
onRegenerate={() => {}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Props = BaseProps & {
disabledRegenerate?: boolean;
disabled?: boolean;
placeholder?: string;
hasRegenerate: boolean;
canRegenerate: boolean;
isLoading: boolean;
onSend: (content: string, base64EncodedImages?: string[]) => void;
onRegenerate: () => void;
Expand Down Expand Up @@ -97,7 +97,7 @@ export const TextInputChatContent = forwardRef<HTMLElement, Props>((props, focus
/>
</div>

{props.hasRegenerate && (
{props.canRegenerate && (
<Button
className="absolute -top-14 right-0 bg-aws-paper p-2 text-sm"
outlined
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/ChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ const ChatPage: React.FC = () => {
? t('bot.label.notAvailableBotInputMessage')
: undefined
}
hasRegenerate={messages.length > 1}
canRegenerate={messages.length > 1}
isLoading={postingMessage}
onSend={onSend}
onRegenerate={onRegenerate}
Expand All @@ -527,8 +527,8 @@ const ChatPage: React.FC = () => {
? t('bot.label.notAvailableBotInputMessage')
: undefined
}
hasRegenerate={messages.length > 1}
hasContinue={getShouldContinue()}
canRegenerate={messages.length > 1}
canContinue={getShouldContinue()}
isLoading={postingMessage}
onSend={onSend}
onRegenerate={onRegenerate}
Expand Down

0 comments on commit 636c9fd

Please sign in to comment.