123
This commit is contained in:
@@ -20,9 +20,11 @@ export interface ContentImageData {
|
||||
interface ContentImageCellProps {
|
||||
image: ContentImageData | null;
|
||||
maxPromptLength?: number;
|
||||
showPrompt?: boolean; // New prop to control prompt visibility
|
||||
onImageClick?: () => void; // Optional click handler
|
||||
}
|
||||
|
||||
export default function ContentImageCell({ image, maxPromptLength = 100 }: ContentImageCellProps) {
|
||||
export default function ContentImageCell({ image, maxPromptLength = 100, showPrompt = false, onImageClick }: ContentImageCellProps) {
|
||||
const [showFullPrompt, setShowFullPrompt] = useState(false);
|
||||
|
||||
// Check if image_path is a valid local file path (not a URL)
|
||||
@@ -65,8 +67,8 @@ export default function ContentImageCell({ image, maxPromptLength = 100 }: Conte
|
||||
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
{/* Prompt Text */}
|
||||
{prompt && (
|
||||
{/* Prompt Text - Only show if showPrompt is true */}
|
||||
{showPrompt && prompt && (
|
||||
<div className="text-sm">
|
||||
<p className="text-gray-700 dark:text-gray-300">
|
||||
{displayPrompt}
|
||||
@@ -83,7 +85,10 @@ export default function ContentImageCell({ image, maxPromptLength = 100 }: Conte
|
||||
)}
|
||||
|
||||
{/* Image Display */}
|
||||
<div className="relative">
|
||||
<div
|
||||
className={`relative ${onImageClick ? 'cursor-pointer' : ''}`}
|
||||
onClick={onImageClick}
|
||||
>
|
||||
{image.status === 'pending' && (
|
||||
<div className="w-full h-24 bg-gray-200 dark:bg-gray-700 rounded border-2 border-dashed border-gray-300 dark:border-gray-600 flex items-center justify-center">
|
||||
<div className="text-center">
|
||||
|
||||
Reference in New Issue
Block a user