mediawiki-extensions-Popups/.storybook/mocks/message.js
jdlrobson f97d29923b Add reference previews to storybook
Change-Id: I8e9e2db66fa94b33abcf7c9cbaff8defe5003ef6
2021-07-22 23:59:26 +00:00

15 lines
356 B
JavaScript

export default function message( key ) {
return {
exists: () => true,
text: () => {
if ( key.indexOf( 'popups-refpreview-' ) > -1 ) {
const type = key.split( 'popups-refpreview-' )[ 1 ];
return type === 'generic' ? 'Reference'
: type[0].toUpperCase() + type.slice( 1 ) + ' reference';
} else {
return `<${key}>`;
}
}
}
};