---
/**
 * Bluesky post embed component for Portable Text
 *
 * Wraps astro-embed's BlueskyPost component, extracting props from the PT block node.
 * astro-portabletext passes `node` (not `value`) for custom type components.
 * 
 * Accepts either `id` or `url` field for compatibility with different content sources.
 */
import { BlueskyPost } from "astro-embed";
import type { BlueskyBlock } from "../schemas.js";

interface Props {
	node: BlueskyBlock & { url?: string };
}

const { node } = Astro.props;
// Support both 'id' (schema) and 'url' (admin editor) field names
const postId = node.id || node.url;
---

{postId && <BlueskyPost id={postId} />}
