mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-12-12 20:46:52 +01:00
chore: config updates
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import { useRouter } from "@repo/i18n/navigation"
|
||||
import { useTranslations } from "next-intl"
|
||||
import { useEffect } from "react"
|
||||
import { useEffect, useTransition } from "react"
|
||||
import { Button } from "../../Design/Button/Button.tsx"
|
||||
import { Typography } from "../../Design/Typography/Typography.tsx"
|
||||
import { MainLayout } from "../../Layout/MainLayout/MainLayout.tsx"
|
||||
@@ -15,6 +16,9 @@ export interface ErrorServerProps {
|
||||
export const ErrorServer: React.FC<ErrorServerProps> = (props) => {
|
||||
const { error, reset } = props
|
||||
|
||||
const [isPending, startTransition] = useTransition()
|
||||
const router = useRouter()
|
||||
|
||||
const t = useTranslations()
|
||||
|
||||
useEffect(() => {
|
||||
@@ -29,7 +33,17 @@ export const ErrorServer: React.FC<ErrorServerProps> = (props) => {
|
||||
</Typography>
|
||||
|
||||
<Typography variant="text1" as="p" className="mt-4">
|
||||
<Button onClick={reset}>{t("errors.try-again")}</Button>
|
||||
<Button
|
||||
isLoading={isPending}
|
||||
onClick={() => {
|
||||
startTransition(() => {
|
||||
router.refresh()
|
||||
reset()
|
||||
})
|
||||
}}
|
||||
>
|
||||
{t("errors.try-again")}
|
||||
</Button>
|
||||
</Typography>
|
||||
</Section>
|
||||
</MainLayout>
|
||||
|
||||
Reference in New Issue
Block a user