Skip to content

Commit 82588ca

Browse files
committed
imrpoved fetching country component ui
1 parent 4f757db commit 82588ca

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

components/CountrySetter.tsx

+24-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ import { getCountryFromIpAddress } from "@/lib/country/getCountryFromIpAddress";
33
import { useEffect, useState } from "react";
44
import { setNewSearchParamsAndPushRoute } from "./product/setNewSearchParamsAndPushRoute";
55
import { useSearchParams, usePathname, useRouter } from "next/navigation";
6+
import { SomethingWrongButton } from "./buttons/SomethingWrongButton";
7+
import {
8+
Card,
9+
CardContent,
10+
CardDescription,
11+
CardFooter,
12+
CardHeader,
13+
CardTitle,
14+
} from "./ui/card";
15+
import { PageLoadingSpinner } from "./loading/PageLoadingSpinner";
616

717
export function CountrySetter() {
818
const [countryCode, setCountryCode] = useState();
@@ -29,5 +39,18 @@ export function CountrySetter() {
2939
});
3040
}
3141

32-
return <>Fetching country...</>;
42+
return (
43+
<Card>
44+
<CardHeader>
45+
<CardTitle>Please wait</CardTitle>
46+
<CardDescription>Fetching country...</CardDescription>
47+
</CardHeader>
48+
<CardContent className="flex flex-col items-center">
49+
<PageLoadingSpinner />
50+
</CardContent>
51+
<CardFooter>
52+
<SomethingWrongButton />
53+
</CardFooter>
54+
</Card>
55+
);
3356
}

0 commit comments

Comments
 (0)