Spaces:
Runtime error
Runtime error
max length for prompt in card
Browse files
components/main/collections/collection.tsx
CHANGED
@@ -49,7 +49,9 @@ export const Collection: React.FC<Props> = ({
|
|
49 |
{formatDate}
|
50 |
</p>
|
51 |
<p className="text-lg font-medium text-white lowercase leading-snug">
|
52 |
-
{collection.prompt
|
|
|
|
|
53 |
</p>
|
54 |
<p
|
55 |
className="text-white text-sm text-right font-semibold mt-2"
|
|
|
49 |
{formatDate}
|
50 |
</p>
|
51 |
<p className="text-lg font-medium text-white lowercase leading-snug">
|
52 |
+
{collection.prompt?.length > 200
|
53 |
+
? `${collection.prompt.slice(0, 200)}...`
|
54 |
+
: collection.prompt}
|
55 |
</p>
|
56 |
<p
|
57 |
className="text-white text-sm text-right font-semibold mt-2"
|
components/main/collections/loading.tsx
CHANGED
@@ -36,7 +36,11 @@ export const CollectionLoading: React.FC<Props> = ({
|
|
36 |
<span />
|
37 |
</div>
|
38 |
)}
|
39 |
-
<p className="text-white/70 font-semibold text-xl">
|
|
|
|
|
|
|
|
|
40 |
</motion.div>
|
41 |
</div>
|
42 |
);
|
|
|
36 |
<span />
|
37 |
</div>
|
38 |
)}
|
39 |
+
<p className="text-white/70 font-semibold text-xl">
|
40 |
+
{error ?? prompt?.length > 180
|
41 |
+
? `${prompt.slice(0, 180)}...`
|
42 |
+
: prompt}
|
43 |
+
</p>
|
44 |
</motion.div>
|
45 |
</div>
|
46 |
);
|