mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
33 lines
942 B
TypeScript
33 lines
942 B
TypeScript
import { useEffect, useState } from 'react'
|
||
|
||
import { HeaderBanner } from '@/components/interfaces/Organization/HeaderBanner'
|
||
import { InlineLink } from '@/components/ui/InlineLink'
|
||
import { useClockSkewQuery } from '@/data/misc/clock-skew-query'
|
||
import { DOCS_URL } from '@/lib/constants'
|
||
|
||
export const ClockSkewBanner = () => {
|
||
const [isClockSkewed, setIsClockSkewed] = useState(false)
|
||
|
||
const { data } = useClockSkewQuery()
|
||
useEffect(() => setIsClockSkewed(!!data), [data])
|
||
|
||
if (!isClockSkewed) return null
|
||
|
||
return (
|
||
<HeaderBanner
|
||
variant="warning"
|
||
title="Your computer’s clock appears to be inaccurate"
|
||
description={
|
||
<>
|
||
This can cause issues with certain features.{' '}
|
||
<InlineLink
|
||
href={`${DOCS_URL}/guides/troubleshooting/jwt-expired-error-in-supabase-dashboard-F06k3x`}
|
||
>
|
||
Learn more
|
||
</InlineLink>
|
||
</>
|
||
}
|
||
/>
|
||
)
|
||
}
|