overleaf/services/web/frontend/js/features/subscription/components/dashboard/managed-publishers.tsx
Alexandre Bourdin d6e9508aed [web] Migrate managed publishers to React dash (#11749)
* Migrate managed publishers to React dash

* Decaf cleanup + async/await PublishersGetter

* Continue migration of managed publishers to react dash

* Fix linting

* Add tests

* Decaf cleanup PublishersGetterTests

* Update PublishersGetter tests

* Rename component files to kebab-case

GitOrigin-RevId: cb1fe14d120457c965a9d23a8ddb2c2c92e1d5da
2023-02-23 09:04:03 +00:00

28 lines
618 B
TypeScript

import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
import ManagedPublisher from './managed-publisher'
export type Publisher = {
slug: string
managerIds: string[]
name: string
partner: string
}
export default function ManagedPublishers() {
const { managedPublishers } = useSubscriptionDashboardContext()
if (!managedPublishers) {
return null
}
return (
<>
{managedPublishers.map(publisher => (
<ManagedPublisher
publisher={publisher}
key={`managed-publisher-${publisher.slug}`}
/>
))}
</>
)
}