caelum0x 2b68bde5d5 Predikt: full Polymarket-style prediction market — web + mobile + on-chain + bots
Working tree is now the canonical repo. Off-chain play-money + trustless on-chain
(FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution,
mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 23:29:50 +03:00

50 lines
1.8 KiB
TypeScript

import { TiptapTweet } from 'common/util/tiptap-tweet'
import { NodeViewWrapper } from '@tiptap/react'
import { TwitterTweetEmbed } from 'react-twitter-embed'
import { PiXLogo } from 'react-icons/pi'
export const DisplayTweet = TiptapTweet.extend({
renderReact: (attrs: any) => <TweetComponent {...attrs} />,
})
function TweetComponent(attrs: any) {
// Remove the leading 't' from the tweet id
const tweetId = attrs.tweetId.slice(1)
return (
<NodeViewWrapper className="tiptap-tweet [&_.twitter-tweet]:mx-auto">
{/* <TweetPlaceholder /> */}
<TwitterTweetEmbed tweetId={tweetId} placeholder={<TweetPlaceholder />} />
</NodeViewWrapper>
)
}
// Simple placeholder resembling a tweet structure
function TweetPlaceholder() {
return (
<div className="mx-auto h-[35rem] w-full animate-pulse rounded-lg border border-ink-200 bg-canvas-0 p-1 shadow-sm sm:p-20">
<div className="flex space-x-4">
<div className="h-12 w-12 rounded-full bg-ink-300"></div>
<div className="flex-1 space-y-1">
<div className="h-4 w-1/2 rounded bg-ink-300"></div>
<div className="h-3 w-1/4 rounded bg-ink-300"></div>
</div>
<PiXLogo className="h-8 w-8" />
</div>
<div className="mt-4 space-y-4">
<div className="h-4 rounded bg-ink-300"></div>
<div className="h-4 rounded bg-ink-300"></div>
<div className="h-4 w-5/6 rounded bg-ink-300"></div>
<div className="h-4 rounded bg-ink-300"></div>
<div className="h-4 w-3/4 rounded bg-ink-300"></div>
<div className="h-4 rounded bg-ink-300"></div>
<div className="h-4 w-4/5 rounded bg-ink-300"></div>
<div className="h-4 rounded bg-ink-300"></div>
<div className="h-4 w-2/3 rounded bg-ink-300"></div>
<div className="h-4 rounded bg-ink-300"></div>
</div>
</div>
)
}