= ({ snippet, stage, onPreview }) => {
const featured = FEATURED_SNIPPET_ID === snippet.id
return (
{isSynced(snippet, stage)
?
: }
)
}
interface ColumnParams {
stage: DemoStage
onPreview: (snippet: CloudSnippetSchema) => void
}
// eslint-disable-next-line max-lines-per-function -- the column set reads as one table definition.
export const cloudLibraryDemoColumns = (
{ stage, onPreview }: ColumnParams
): ListTableColumn[] => [
{
id: 'state',
title: ,
render: snippet =>
},
{
id: 'name',
title: __('Snippet Name', 'code-snippets'),
isPrimary: true,
sortedValue: snippet => getSnippetDisplayName(snippet).toLowerCase(),
render: snippet => {snippet.name}
},
{
id: 'type',
title: __('Type', 'code-snippets'),
sortedValue: snippet => getSnippetType(snippet),
render: snippet =>
},
{
id: 'status',
title: __('Status', 'code-snippets'),
sortedValue: snippet => snippet.status,
render: snippet =>
},
{
id: 'desc',
title: __('Description', 'code-snippets'),
render: snippet =>
{truncateChars(stripTags(snippet.description))}
},
{
id: 'tags',
title: __('Tags', 'code-snippets'),
render: snippet =>
},
{
id: 'date',
title: __('Updated', 'code-snippets'),
sortedValue: snippet => new Date(snippet.updated).toISOString(),
render: snippet =>
},
{
id: 'actions',
title: {__('Actions', 'code-snippets')},
render: snippet =>
}
]