/** * WordPress dependencies */ import { useSelect } from '@safe-wordpress/data'; import { _x, sprintf } from '@safe-wordpress/i18n'; /** * External dependencies */ import clsx from 'clsx'; import type { OptionProps } from 'react-select'; import { store as NAB_DATA } from '@nab/data'; import { formatI18nDate } from '@nab/date'; import type { EntityId, EntityKindName } from '@nab/types'; export type PostData = { readonly type: EntityKindName; readonly value: EntityId; readonly label: string; }; export const PostOption = ( { data: { type, value }, isFocused, isSelected, innerRef, innerProps, }: OptionProps< PostData, false > ): JSX.Element => { const post = usePost( type, value ); const { id, authorName, date, thumbnailSrc, title, typeLabel, statusLabel, } = post || {}; return (