https://payloadcms.com/docs/fields/blocks#customizing-the-way-your-block-is-rendered-in-lexical
Documentation specifies passing Block path, however I dont see an example or recommended way of getting the block field props into the below component example.
admin: {
components: {
Block: {
path: "@/blocks/Twitter/TwitterField#default",
},
},
},
const TwitterField: FC<any> = (props) => {
const { field, path, value } = props;
// console.log(props);
// was testing this out, but seems like props here include everything
return (
<div
style={{
padding: "20px",
// backgroundColor: "#f0f0f0",
borderRadius: "5px",
}}
>
<BlockEditButton />
<div style={{ fontWeight: "bold", marginBottom: "10px" }}>
Twitter/X Post Preview (full preview visible when published)
</div>
<div style={{ fontStyle: "italic", fontSize: "0.9em" }}>
{field?.tweetURL ||
(field?.tweetId
? `Tweet ID: ${value.tweetId}`
: "No tweet specified")}
</div>
</div>
);
};