forked from Prompt-Hash-Stellar/prompt-hash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPromptTrustMetadata.tsx
More file actions
27 lines (26 loc) · 1.15 KB
/
Copy pathPromptTrustMetadata.tsx
File metadata and controls
27 lines (26 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from 'react';
export const PromptTrustMetadata: React.FC<{ creatorAddress: string; salesCount: number; contentHash: string; purchased: boolean }> = ({ creatorAddress, salesCount, contentHash, purchased }) => {
return (
<div className="flex flex-col space-y-2 text-sm text-gray-600 dark:text-gray-400 p-4 border rounded-md">
<div className="flex justify-between">
<span className="font-semibold">Creator:</span>
<span className="truncate w-32" title={creatorAddress}>{creatorAddress}</span>
</div>
<div className="flex justify-between">
<span className="font-semibold">Sales:</span>
<span>{salesCount}</span>
</div>
<div className="flex justify-between">
<span className="font-semibold">Hash:</span>
<span className="truncate w-32" title={contentHash}>{contentHash}</span>
</div>
<div className="mt-4">
{purchased ? (
<button className="w-full bg-green-500 text-white py-2 rounded">Unlock Prompt</button>
) : (
<button className="w-full bg-blue-500 text-white py-2 rounded">Buy Prompt</button>
)}
</div>
</div>
);
};