Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.1 KB
Raw Blame
import { MakeLogicType, kea, path, selectors } from 'kea'

import { organizationLogic } from 'scenes/organizationLogic'

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface interProjectCopyLogicValues {
    canCopyToProject: boolean
}

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface interProjectCopyLogicMeta {
    __keaTypeGenInternalSelectorTypes: {
        canCopyToProject: (currentOrganization: null | import('../../types').OrganizationType) => boolean
    }
}

export type interProjectCopyLogicType = MakeLogicType<
    interProjectCopyLogicValues,
    {},
    Record<string, any>,
    interProjectCopyLogicMeta
>

export const interProjectCopyLogic = kea<interProjectCopyLogicType>([
    path(['scenes', 'resource-transfer', 'interProjectCopyLogic']),

    selectors({
        canCopyToProject: [
            () => [organizationLogic.selectors.currentOrganization],
            (currentOrganization: null | import('../../types').OrganizationType): boolean => {
                return (currentOrganization?.teams?.length ?? 0) > 1
            },
        ],
    }),
])