// @flow import React from 'react'; import { useHistory } from 'react-router'; import { EDIT_PAGE, PAGE_VIEW_QUERY } from 'page/collection/view'; import Card from 'component/common/card'; import CollectionActions from '../collectionActions'; import ClaimDescription from 'component/claimDescription'; import Icon from 'component/common/icon'; import Button from 'component/button'; import ClaimAuthor from 'component/claimAuthor'; import * as COLLECTIONS_CONSTS from 'constants/collections'; import * as ICONS from 'constants/icons'; import Spinner from 'component/spinner'; import CollectionPrivateIcon from 'component/common/collection-private-icon'; type Props = { collectionId: string, showEdit: boolean, unavailableUris: Array, setShowEdit: (show: boolean) => void, setUnavailable: (uris: Array) => void, // -- redux -- uri: string, collection: Collection, collectionCount: number, claimIsPending: boolean, collectionHasEdits: boolean, publishedCollectionCount: ?number, isMyCollection: boolean, doCollectionEdit: (collectionId: string, params: CollectionEditParams) => void, }; const CollectionHeader = (props: Props) => { const { collectionId, showEdit, unavailableUris, setShowEdit, setUnavailable, // -- redux -- uri, collection, collectionCount, claimIsPending, collectionHasEdits, publishedCollectionCount, isMyCollection, doCollectionEdit, } = props; const { push } = useHistory(); const isBuiltin = COLLECTIONS_CONSTS.BUILTIN_PLAYLISTS.includes(collectionId); const listName = collection?.name; return ( {isBuiltin ? __(listName) : listName} {collectionHasEdits ? __(' (Published playlist with pending changes)') : undefined} } titleActions={ unavailableUris.length > 0 ? (