mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 11:25:06 +03:00
Another small refactor
This commit is contained in:
1 parent
5e04787230
commit
157bc6aa01
3 files changed
+4
-13
No files matched your search
@@ -11,10 +11,9 @@ import { UsageStats, ApiUsageStats } from './ProjectUsageBars.types'
|
||||
|
||||
interface Props {
|
||||
projectRef?: string
|
||||
subscription_id?: string
|
||||
}
|
||||
|
||||
const ProjectUsage: FC<Props> = ({ projectRef, subscription_id }) => {
|
||||
const ProjectUsage: FC<Props> = ({ projectRef }) => {
|
||||
const { ui } = useStore()
|
||||
const { data: stats, error: usageError } = useSWR(`${API_URL}/projects/${projectRef}/usage`, get)
|
||||
const { subscription, isLoading: loading, error } = useProjectSubscription(projectRef)
|
||||
@@ -112,11 +111,7 @@ interface ProjectUsageMinimalProps extends Props {
|
||||
filter: string
|
||||
}
|
||||
|
||||
export const ProjectUsageMinimal: FC<ProjectUsageMinimalProps> = ({
|
||||
projectRef,
|
||||
subscription_id,
|
||||
filter,
|
||||
}) => {
|
||||
export const ProjectUsageMinimal: FC<ProjectUsageMinimalProps> = ({ projectRef, filter }) => {
|
||||
const { data: apiStats, error: usageError } = useSWR<ApiUsageStats>(
|
||||
`${API_URL}/projects/${projectRef}/usage`,
|
||||
get
|
||||
|
||||
@@ -118,7 +118,7 @@ const Settings: FC<SettingsProps> = ({ project }) => {
|
||||
{paygStats && dateRange && <PAYGUsage paygStats={paygStats} dateRange={dateRange} />}
|
||||
</div>
|
||||
) : (
|
||||
<ProjectUsage projectRef={project?.ref} subscription_id={project?.subscription_id} />
|
||||
<ProjectUsage projectRef={project?.ref} />
|
||||
)}
|
||||
<div className="space-y-2">
|
||||
<h4 className="text-lg">Invoices</h4>
|
||||
|
||||
@@ -133,11 +133,7 @@ const Usage: FC<any> = ({ project }) => {
|
||||
}
|
||||
>
|
||||
<Panel.Content>
|
||||
<ProjectUsageMinimal
|
||||
projectRef={ref}
|
||||
subscription_id={project.subscription_id}
|
||||
filter={'Database'}
|
||||
/>
|
||||
<ProjectUsageMinimal projectRef={ref} filter={'Database'} />
|
||||
</Panel.Content>
|
||||
</Panel>
|
||||
</section>
|
||||
|
||||
Reference in new issue
Block a user