= ({
!post.content && !isAnswer
? `rounded-xl bg-neutral-50 hover:-translate-y-2 dark:bg-neutral-900`
: `rounded-r-xl border-l-2 border-blue-500 bg-primary/5`
- }`}
+ } ${isPending && `animate-pulse duration-700`}`}
onClick={() => {
- if (isExtendedQuestion(post)) {
- router.push(`/question/${post?.slug}`);
- }
+ startTransition(() => {
+ if (isExtendedQuestion(post)) {
+ router.push(`/question/${post?.slug}`);
+ }
+ });
}}
>
diff --git a/src/components/posts/form/form-input.tsx b/src/components/posts/form/form-input.tsx
index d68d11f9e..577bd81a9 100644
--- a/src/components/posts/form/form-input.tsx
+++ b/src/components/posts/form/form-input.tsx
@@ -1,5 +1,6 @@
'use client';
+import React from 'react';
import { forwardRef } from 'react';
import { useFormStatus } from 'react-dom';
@@ -19,6 +20,7 @@ interface FormInputProps {
className?: string;
defaultValue?: string;
onBlur?: () => void;
+ onKeyUp?: (event: React.KeyboardEvent) => void;
}
export const FormPostInput = forwardRef(
@@ -33,6 +35,7 @@ export const FormPostInput = forwardRef(
errors,
className,
defaultValue = '',
+ onKeyUp,
onBlur,
},
ref,
@@ -57,6 +60,7 @@ export const FormPostInput = forwardRef(
required={required}
name={id}
id={id}
+ onKeyUp={onKeyUp}
placeholder={placeholder}
type={type}
disabled={pending || disabled}
@@ -73,4 +77,4 @@ export const FormPostInput = forwardRef(
},
);
-FormPostInput.displayName = 'FormPostInput';
+FormPostInput.displayName = 'FormPostInput';
\ No newline at end of file