import type { BlockModel } from '@blockeditor/store';
import type { TemplateResult } from 'lit';
import { html } from 'lit';
import type { ParagraphType } from '../../../paragraph-block/index.js';
const bulleted = html` `;
const numbered = html` `;
const todo = html` `;
const toggle = html` `;
const text = html` `;
const quote = html` `;
const h1 = html` `;
const h2 = html` `;
const h3 = html` `;
const h4 = html` `;
const h5 = html` `;
const h6 = html` `;
export const getIcon = (
model: BlockModel & { type?: string }
): TemplateResult => {
if (model.flavour === 'affine:paragraph') {
const type = model.type as ParagraphType;
return (
{
text: text,
quote: quote,
h1: h1,
h2: h2,
h3: h3,
h4: h4,
h5: h5,
h6: h6,
} as Record
)[type];
}
if (model.flavour === 'affine:list') {
return (
{
bulleted: bulleted,
numbered: numbered,
todo: todo,
toggle: toggle,
}[model.type ?? 'bulleted'] ?? html``
);
}
return html``;
};