'use client' import { REPLY_PERMISSIONS, REPLY_PERMISSION_META, type ReplyPermission, } from '@/services/postService' interface ReplyPermissionIconProps { permission: ReplyPermission className?: string } function ReplyPermissionIcon({ permission, className }: ReplyPermissionIconProps) { const common = { className: className ?? 'w-4 h-4', fill: 'none' as const, stroke: 'currentColor', viewBox: '0 0 24 24', strokeWidth: 2, } if (permission === 'nobody') { return ( ) } if (permission === 'everyone') { return ( ) } // followers / mentioned — a group glyph return ( ) } // --------------------------------------------------------------------------- // Selector (composer) // --------------------------------------------------------------------------- interface WhoCanReplySelectorProps { value: ReplyPermission onChange: (next: ReplyPermission) => void } /** * Composer control for choosing who can reply to a post, ported from Bluesky's * ThreadgateBtn to the product's stack. */ export function WhoCanReplySelector({ value, onChange }: WhoCanReplySelectorProps) { return (
Who can reply
{REPLY_PERMISSIONS.map((perm) => { const selected = value === perm return ( ) })}
) } // --------------------------------------------------------------------------- // Read-only notice (post view) // --------------------------------------------------------------------------- interface WhoCanReplyNoticeProps { permission: ReplyPermission } /** * Read-only notice rendered on a post that communicates any reply restriction. * Renders nothing when anyone can reply (the default), to avoid visual noise. */ export function WhoCanReplyNotice({ permission }: WhoCanReplyNoticeProps) { if (permission === 'everyone') return null const meta = REPLY_PERMISSION_META[permission] return (
{meta.notice}
) }