"use client";

import type { ReactNode } from "react";
import { ConfigProvider } from "antd";
import zhCN from "antd/locale/zh_CN";

type ProvidersProps = {
  children: ReactNode;
};

export function Providers({ children }: ProvidersProps) {
  return (
    <ConfigProvider
      locale={zhCN}
      theme={{
        token: {
          colorPrimary: "#16a34a",
          colorSuccess: "#52c41a",
          colorText: "#12301f",
          colorBgLayout: "#edfdf2",
          colorBgContainer: "rgba(255, 255, 255, 0.82)",
          colorBorder: "rgba(22, 101, 52, 0.16)",
          borderRadius: 8,
          fontFamily:
            'Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif'
        },
        components: {
          Button: {
            borderRadius: 8,
            controlHeight: 42
          },
          Card: {
            borderRadiusLG: 8
          },
          Anchor: {
            linkPaddingBlock: 8,
            linkPaddingInlineStart: 12
          },
          Tag: {
            borderRadiusSM: 6
          }
        }
      }}
    >
      {children}
    </ConfigProvider>
  );
}
