|
1 |
| -import React, { HTMLAttributes, useEffect, useMemo, useState } from "react" |
| 1 | +import React, { |
| 2 | + type ButtonHTMLAttributes, |
| 3 | + forwardRef, |
| 4 | + HTMLAttributes, |
| 5 | + useEffect, |
| 6 | + useMemo, |
| 7 | + useState, |
| 8 | +} from "react" |
2 | 9 | import { GetStaticProps, InferGetServerSidePropsType } from "next"
|
3 | 10 | import { useRouter } from "next/router"
|
4 | 11 | import { useTranslation } from "next-i18next"
|
5 | 12 | import { serverSideTranslations } from "next-i18next/serverSideTranslations"
|
6 | 13 | import { FaGithub } from "react-icons/fa"
|
7 |
| -import { forwardRef } from "@chakra-ui/react" |
8 | 14 |
|
9 | 15 | import { BasePageProps, Lang } from "@/lib/types"
|
10 | 16 |
|
@@ -45,22 +51,25 @@ type LinkFlexProps = FlexProps & {
|
45 | 51 | href: string
|
46 | 52 | }
|
47 | 53 |
|
48 |
| -const FilterTag = forwardRef<{ isActive: boolean; name: string }, "button">( |
49 |
| - (props, ref) => { |
50 |
| - const { isActive, name, ...rest } = props |
51 |
| - return ( |
52 |
| - <TagButton |
53 |
| - ref={ref} |
54 |
| - variant={isActive ? "solid" : "outline"} |
55 |
| - status={isActive ? "tag" : "normal"} |
56 |
| - className="justify-center" |
57 |
| - {...rest} |
58 |
| - > |
59 |
| - {name} |
60 |
| - </TagButton> |
61 |
| - ) |
62 |
| - } |
63 |
| -) |
| 54 | +const FilterTag = forwardRef< |
| 55 | + HTMLButtonElement, |
| 56 | + { isActive: boolean; name: string } & ButtonHTMLAttributes<HTMLButtonElement> |
| 57 | +>((props, ref) => { |
| 58 | + const { isActive, name, ...rest } = props |
| 59 | + return ( |
| 60 | + <TagButton |
| 61 | + ref={ref} |
| 62 | + variant={isActive ? "solid" : "outline"} |
| 63 | + status={isActive ? "tag" : "normal"} |
| 64 | + className="justify-center" |
| 65 | + {...rest} |
| 66 | + > |
| 67 | + {name} |
| 68 | + </TagButton> |
| 69 | + ) |
| 70 | +}) |
| 71 | + |
| 72 | +FilterTag.displayName = "FilterTag" |
64 | 73 |
|
65 | 74 | const Text = ({ className, ...props }: HTMLAttributes<HTMLHeadElement>) => (
|
66 | 75 | <p className={cn("mb-6", className)} {...props} />
|
|
0 commit comments