Feature: add link to openai account usage (#319)

* Update ModelSelect.tsx to include link to account usage

It would be helpful to be able to click a link to see the account usage and billing, and the model selection is related to the pricing.

* updated styling and added icon for external link

* fixed missing import
This commit is contained in:
Rudolf Olah 2023-03-30 22:10:11 -04:00 committed by GitHub
parent 22bcaef805
commit c1b7b0e070
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import { OpenAIModel, OpenAIModelID } from '@/types/openai';
import { useTranslation } from 'next-i18next';
import { IconExternalLink } from '@tabler/icons-react';
import { FC } from 'react';
interface Props {
@ -48,6 +49,12 @@ export const ModelSelect: FC<Props> = ({
))}
</select>
</div>
<div className="w-full mt-3 text-left text-neutral-700 dark:text-neutral-400 flex items-center">
<a href="https://platform.openai.com/account/usage" target="_blank" className="flex items-center">
<IconExternalLink size={18} className={"inline mr-1"} />
{t('View Account Usage')}
</a>
</div>
</div>
);
};