HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/wp-recipe-maker/assets/js/shared/Ideas.js
import { __wprm } from './Translations';

export const ideaStatusOptions = [
    { value: 'idea', label: __wprm( 'Idea' ) },
    { value: 'planned', label: __wprm( 'Planned' ) },
    { value: 'in-progress', label: __wprm( 'In Progress' ) },
    { value: 'published', label: __wprm( 'Published' ) },
    { value: 'dismissed', label: __wprm( 'Dismissed' ) },
];

export const ideaTypeOptions = [
    { value: 'recipe', label: __wprm( 'Recipe' ) },
    { value: 'list', label: __wprm( 'List' ) },
    { value: 'other', label: __wprm( 'Other' ) },
];

export const ideaStatusFilterOptions = [
    { value: 'all', label: __wprm( 'All' ) },
    { value: 'not-started', label: __wprm( 'Not Started' ) },
    ...ideaStatusOptions,
];

export const ideaSourceOptions = [
    { value: 'manual', label: __wprm( 'Manual' ) },
    { value: 'ai', label: __wprm( 'AI' ) },
];

export const getIdeaOptionLabel = ( options, value ) => {
    const option = options.find( ( item ) => item.value === value );
    return option ? option.label : value;
};

export const getIdeaLabel = ( type, value ) => {
    switch ( type ) {
        case 'status':
            return getIdeaOptionLabel( ideaStatusOptions, value );
        case 'type':
            return getIdeaOptionLabel( ideaTypeOptions, value );
        case 'source':
            return getIdeaOptionLabel( ideaSourceOptions, value );
        default:
            return value;
    }
};