add hover to all country flags
All checks were successful
Deploy Website / deploy (push) Successful in 5m5s

This commit is contained in:
Lee
2024-10-13 00:41:39 +01:00
parent b7783f5a4d
commit ae2f30a97a
3 changed files with 21 additions and 10 deletions

View File

@ -1,3 +1,6 @@
import Tooltip from "@/components/tooltip";
import { normalizedRegionName } from "@ssr/common/utils/region-utils";
type Props = {
code: string;
size?: number;
@ -5,12 +8,14 @@ type Props = {
export default function CountryFlag({ code, size = 24 }: Props) {
return (
// eslint-disable-next-line @next/next/no-img-element
<img
alt="Player Country"
src={`/assets/flags/${code.toLowerCase()}.png`}
width={size * 2}
className={`w-[${size * 2}px] object-contain`}
/>
<Tooltip display={<p>{normalizedRegionName(code)}</p>} asChild={false}>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
alt="Player Country"
src={`/assets/flags/${code.toLowerCase()}.png`}
width={size * 2}
className={`w-[${size * 2}px] object-contain`}
/>
</Tooltip>
);
}