fix : use native emoji picker instead of cdn emoji

This commit is contained in:
2026-10-08 18:30:24 +07:00 Unverified
parent 690ee343db
commit d54b4fc963
+7 -2
View File
@@ -1,6 +1,6 @@
"use client"; "use client";
import { useEffect, useId, useRef, useState, type ClipboardEvent, type FormEvent } from "react"; import { useEffect, useId, useRef, useState, type ClipboardEvent, type ComponentProps, type FormEvent } from "react";
import dynamic from "next/dynamic"; import dynamic from "next/dynamic";
import { ImagePlusIcon, SmilePlusIcon, XIcon } from "lucide-react"; import { ImagePlusIcon, SmilePlusIcon, XIcon } from "lucide-react";
import { toast } from "sonner"; import { toast } from "sonner";
@@ -15,7 +15,12 @@ import type { CommentImage, CommentItem } from "@/lib/comments/types";
import { CommentImageView } from "./comment-image"; import { CommentImageView } from "./comment-image";
import { COMMENT_ERRORS } from "./client"; import { COMMENT_ERRORS } from "./client";
const EmojiPicker = dynamic(() => import("emoji-picker-react"), { ssr: false }); const EmojiPicker = dynamic(async () => {
const { default: Picker, EmojiStyle } = await import("emoji-picker-react");
return function NativeEmojiPicker(props: ComponentProps<typeof Picker>) {
return <Picker {...props} emojiStyle={EmojiStyle.NATIVE} />;
};
}, { ssr: false });
function FilePreview({ file }: { file: File }) { function FilePreview({ file }: { file: File }) {
const imageRef = useRef<HTMLImageElement>(null); const imageRef = useRef<HTMLImageElement>(null);