diff --git a/check-locale.js b/check-locale.js index 091835878..8252f6329 100644 --- a/check-locale.js +++ b/check-locale.js @@ -16,7 +16,7 @@ const exceptionList = [ 'invalid-credentials', 'no-credentials', 'token-not-found', -] +]; const allStrings = {}; diff --git a/components/apiKey/APIKeys.tsx b/components/apiKey/APIKeys.tsx index 03171f79d..d205f5836 100644 --- a/components/apiKey/APIKeys.tsx +++ b/components/apiKey/APIKeys.tsx @@ -1,14 +1,13 @@ import { EmptyState, WithLoadingAndError } from '@/components/shared'; import ConfirmationDialog from '@/components/shared/ConfirmationDialog'; -import fetcher from '@/lib/fetcher'; import type { ApiKey, Team } from '@prisma/client'; import { useTranslation } from 'next-i18next'; import { useState } from 'react'; import { Button } from 'react-daisyui'; import { toast } from 'react-hot-toast'; -import useSWR from 'swr'; import type { ApiResponse } from 'types'; import NewAPIKey from './NewAPIKey'; +import useAPIKeys from 'hooks/useAPIKeys'; import { Table } from '@/components/shared/table/Table'; interface APIKeysProps { @@ -17,17 +16,12 @@ interface APIKeysProps { const APIKeys = ({ team }: APIKeysProps) => { const { t } = useTranslation('common'); + const { data, isLoading, error, mutate } = useAPIKeys(team.slug); const [selectedApiKey, setSelectedApiKey] = useState(null); const [createModalVisible, setCreateModalVisible] = useState(false); const [confirmationDialogVisible, setConfirmationDialogVisible] = useState(false); - // Fetch API Keys - const { data, isLoading, error, mutate } = useSWR<{ data: ApiKey[] }>( - `/api/teams/${team.slug}/api-keys`, - fetcher - ); - // Delete API Key const deleteApiKey = async (apiKey: ApiKey | null) => { if (!apiKey) return; diff --git a/components/shared/Badge.tsx b/components/shared/Badge.tsx index 11224fc29..765434b73 100644 --- a/components/shared/Badge.tsx +++ b/components/shared/Badge.tsx @@ -1,3 +1,4 @@ +import classNames from 'classnames'; import { BadgeProps, Badge as BaseBadge } from 'react-daisyui'; const Badge = (props: BadgeProps) => { @@ -7,7 +8,7 @@ const Badge = (props: BadgeProps) => { <> {children} diff --git a/components/shared/InputWithCopyButton.tsx b/components/shared/InputWithCopyButton.tsx index 1d6bd1432..91dcc51ed 100644 --- a/components/shared/InputWithCopyButton.tsx +++ b/components/shared/InputWithCopyButton.tsx @@ -19,9 +19,9 @@ const InputWithCopyButton = (props: InputWithCopyButtonProps) => { {description && (