mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
18 lines
419 B
JavaScript
18 lines
419 B
JavaScript
|
export default function snippetIcon(snippet) {
|
||
|
let {mobiledoc} = snippet;
|
||
|
|
||
|
if (mobiledoc.cards.length === 0) {
|
||
|
return 'koenig/kg-card-type-snippet-text';
|
||
|
}
|
||
|
|
||
|
let hasRichText = mobiledoc.sections.some((section) => {
|
||
|
return section[0] !== 10;
|
||
|
});
|
||
|
|
||
|
if (hasRichText) {
|
||
|
return 'koenig/kg-card-type-snippet-combination';
|
||
|
}
|
||
|
|
||
|
return 'koenig/kg-card-type-snippet-block';
|
||
|
}
|