'use client' import { useOrg } from '@components/Contexts/OrgContext' import AuthenticatedClientElement from '@components/Security/AuthenticatedClientElement' import ConfirmationModal from '@components/StyledElements/ConfirmationModal/ConfirmationModal' import { getUriWithOrg } from '@services/config/config' import { deleteCollection } from '@services/courses/collections' import { getCourseThumbnailMediaDirectory } from '@services/media/media' import { revalidateTags } from '@services/utils/ts/requests' import { X } from 'lucide-react' import { useLHSession } from '@components/Contexts/LHSessionContext' import Link from 'next/link' import { useRouter } from 'next/navigation' import React from 'react' type PropsType = { collection: any orgslug: string org_id: string } const removeCollectionPrefix = (collectionid: string) => { return collectionid.replace('collection_', '') } function CollectionThumbnail(props: PropsType) { const org = useOrg() as any return (
{props.collection.courses.slice(0, 2).map((course: any) => ( <>
))}

{props.collection.name}

) } const CollectionAdminEditsArea = (props: any) => { const router = useRouter() const session = useLHSession() as any; const deleteCollectionUI = async (collectionId: number) => { await deleteCollection(collectionId, session.data?.tokens?.access_token) await revalidateTags(['collections'], props.orgslug) // reload the page router.refresh() } return (
} functionToExecute={() => deleteCollectionUI(props.collection_uuid)} status="warning" >
) } export default CollectionThumbnail