import React from 'react';
import { getProviderDisplayName } from '../../../config/modelProviders';
import { getChatProvider } from '../../../lib/providers';
export const useProviderMetadata = (providerId) => {
    const providerMetadata = React.useMemo(() => {
        if (!providerId) {
            return null;
        }
        const resolvedProviderId = providerId;
        try {
            return getChatProvider(resolvedProviderId).metadata;
        }
        catch (error) {
            console.warn('No chat provider registered for id', resolvedProviderId, error);
            return null;
        }
    }, [providerId]);
    const providerDisplayBase = providerId ? getProviderDisplayName(providerId) : '—';
    const isProviderComingSoon = providerMetadata?.isImplemented === false;
    const isProviderImplemented = providerMetadata?.isImplemented !== false;
    const providerBadgeLabel = isProviderComingSoon && providerDisplayBase !== '—'
        ? `${providerDisplayBase} · coming soon`
        : providerDisplayBase;
    return {
        providerMetadata,
        providerDisplayBase,
        providerBadgeLabel,
        isProviderComingSoon,
        isProviderImplemented
    };
};
