Format short CIDs and addresses
Format short CIDs and addresses in Bitsocial React Hooks. Usage, options, and examples.
import { useComment, useAuthorAddress } from "@bitsocial/bitsocial-react-hooks";
const comment = useComment({ commentCid });
const { shortAuthorAddress } = useAuthorAddress({ comment });
// CID labels are presentation logic in your app; keep the full CID for links.
const shortParentCid = comment.parentCid
? `${comment.parentCid.slice(0, 8)}…${comment.parentCid.slice(-6)}`
: undefined;