Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion webview-ui/src/components/chat/ChatRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,12 @@ export const ChatRowContent = ({
)

case "payment_required_prompt": {
return <LowCreditWarning message={message} />
return (
<LowCreditWarning
message={message}
isOrganization={!!apiConfiguration.kilocodeOrganizationId}
/>
)
}
case "invalid_model": {
return <InvalidModelWarning message={message} isLast={isLast} />
Expand Down
22 changes: 18 additions & 4 deletions webview-ui/src/components/kilocode/chat/LowCreditWarning.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { ClineMessage } from "@roo-code/types"
import { ClineMessage, getAppUrl, TelemetryEventName } from "@roo-code/types"
import { vscode } from "@src/utils/vscode"
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
import { RetryIconButton } from "../common/RetryIconButton"
import styled from "styled-components"
import { useTranslation } from "react-i18next"
import { FreeModelsLink } from "../FreeModelsLink"
import { VSCodeButtonLink } from "@/components/common/VSCodeButtonLink"
import { telemetryClient } from "@/utils/TelemetryClient"

type LowCreditWarningProps = {
message: ClineMessage
isOrganization: boolean
}

const HeaderContainer = styled.div`
Expand All @@ -24,7 +26,7 @@ const Description = styled.div`
overflow-wrap: anywhere;
`

export const LowCreditWarning = ({ message }: LowCreditWarningProps) => {
export const LowCreditWarning = ({ message, isOrganization }: LowCreditWarningProps) => {
const { t } = useTranslation()
let data = { title: "Error", message: "Payment required.", balance: "-?.??", buyCreditsUrl: "" }

Expand Down Expand Up @@ -77,7 +79,19 @@ export const LowCreditWarning = ({ message }: LowCreditWarningProps) => {
}}>
{t("kilocode:lowCreditWarning.addCredit")}
</VSCodeButton>
<FreeModelsLink className="p-1 w-full rounded mt-1" origin="chat" />
{!isOrganization && (
<VSCodeButtonLink
onClick={() => {
telemetryClient.capture(TelemetryEventName.CREATE_ORGANIZATION_LINK_CLICKED, {
origin: "low-credit-warning",
})
}}
href={getAppUrl("/organizations/new")}
appearance="primary"
className="p-1 w-full rounded">
{t("kilocode:lowCreditWarning.newOrganization")}
</VSCodeButtonLink>
)}
</div>
</>
)
Expand Down
3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/ar/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/ca/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/cs/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/de/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/en/kilocode.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"lowCreditWarning": {
"addCredit": "Add Credit",
"lowBalance": "Your Kilo Code balance is low"
"lowBalance": "Your Kilo Code balance is low",
"newOrganization": "Using Kilo for work?"
},
"memoryWarning": {
"message": "Memory usage is at {{percentage}}%. Please restart your IDE to prevent crashes."
Expand Down
3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/es/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/fr/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/hi/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/id/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/it/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/ja/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/ko/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/nl/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/pl/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/pt-BR/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/ru/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/th/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/tr/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/uk/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/vi/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/zh-CN/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/zh-TW/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading