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.

2.1 KB
Raw Blame
import { Meta, StoryObj } from '@storybook/react'

import { useStorybookMocks } from '~/mocks/browser'

import { OAuthApps } from './OAuthApps'

const meta: Meta = {
    title: 'Scenes-Other/Settings/Organization/OAuth Apps',
    component: OAuthApps,
}
export default meta

type Story = StoryObj<{}>

export const Empty: Story = {
    render: () => {
        useStorybookMocks({
            get: {
                '/api/organizations/:organization_id/oauth_applications/': {
                    count: 0,
                    next: null,
                    previous: null,
                    results: [],
                },
            },
        })
        return <OAuthApps />
    },
}

export const WithApps: Story = {
    render: () => {
        useStorybookMocks({
            get: {
                '/api/organizations/:organization_id/oauth_applications/': {
                    count: 2,
                    next: null,
                    previous: null,
                    results: [
                        {
                            id: '1',
                            name: 'Acme Analytics',
                            client_id: 'abc123def456ghi789',
                            redirect_uris_list: ['https://acme.example.com/callback'],
                            is_verified: true,
                            created: '2025-11-01T10:30:00Z',
                            updated: '2025-11-01T10:30:00Z',
                        },
                        {
                            id: '2',
                            name: 'Internal Dashboard',
                            client_id: 'xyz987uvw654rst321',
                            redirect_uris_list: [
                                'https://dashboard.internal.dev/auth',
                                'http://localhost:3000/auth/callback',
                            ],
                            is_verified: false,
                            created: '2025-12-15T14:00:00Z',
                            updated: '2025-12-15T14:00:00Z',
                        },
                    ],
                },
            },
        })
        return <OAuthApps />
    },
}