mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
fix: unnecesary requests
This commit is contained in:
@ -13,20 +13,9 @@ export function StatusWidgetContainer() {
|
|||||||
|
|
||||||
function StatusWidgetFallback() {
|
function StatusWidgetFallback() {
|
||||||
return (
|
return (
|
||||||
<a
|
<div className="border-border inline-flex max-w-fit items-center justify-between space-x-2 rounded-md border border-gray-200 px-2 py-2 pr-3 text-sm">
|
||||||
className="border-border inline-flex max-w-fit items-center justify-between gap-2 space-x-2 rounded-md border border-gray-200 px-3 py-1 text-sm"
|
<span className="bg-muted h-2 w-36 animate-pulse rounded-md" />
|
||||||
href="https://status.documenso.com"
|
<span className="bg-muted relative inline-flex h-2 w-2 rounded-full" />
|
||||||
target="_blank"
|
</div>
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<p className="text-sm">Operational</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<span className="relative ml-auto flex h-1.5 w-1.5">
|
|
||||||
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75" />
|
|
||||||
<span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-green-500" />
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { use } from 'react';
|
import { use, useMemo } from 'react';
|
||||||
|
|
||||||
import { type Status, getStatus } from '@openstatus/react';
|
import type { Status } from '@openstatus/react';
|
||||||
|
import { getStatus } from '@openstatus/react';
|
||||||
|
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
|
|
||||||
@ -45,7 +46,8 @@ const getStatusLevel = (level: Status) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function StatusWidget() {
|
export function StatusWidget() {
|
||||||
const { status } = use(getStatus('documenso-status'));
|
const getStatusMemoized = useMemo(async () => getStatus('documenso-status'), []);
|
||||||
|
const { status } = use(getStatusMemoized);
|
||||||
const level = getStatusLevel(status);
|
const level = getStatusLevel(status);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user