diff --git a/app/javascript/dashboard/components/helpCenter/ArticleItem.stories.js b/app/javascript/dashboard/components/helpCenter/ArticleItem.stories.js new file mode 100644 index 000000000..18dc8295c --- /dev/null +++ b/app/javascript/dashboard/components/helpCenter/ArticleItem.stories.js @@ -0,0 +1,63 @@ +import ArticleItemComponent from './ArticleItem.vue'; +const STATUS_LIST = { + published: 'published', + draft: 'draft', + archived: 'archived', +}; + +export default { + title: 'Components/Help Center', + component: ArticleItemComponent, + argTypes: { + title: { + defaultValue: 'Setup your account', + control: { + type: 'text', + }, + }, + readCount: { + defaultValue: 13, + control: { + type: 'number', + }, + }, + category: { + defaultValue: 'Getting started', + control: { + type: 'text', + }, + }, + status: { + defaultValue: 'Status', + control: { + type: 'select', + options: STATUS_LIST, + }, + }, + updatedAt: { + defaultValue: '1657255863', + control: { + type: 'number', + }, + }, + }, +}; + +const Template = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { ArticleItemComponent }, + template: + '', +}); + +export const ArticleItem = Template.bind({}); +ArticleItem.args = { + title: 'Setup your account', + author: { + name: 'John Doe', + }, + category: 'Getting started', + readCount: 12, + status: 'published', + updatedAt: 1657255863, +}; diff --git a/app/javascript/dashboard/components/helpCenter/ArticleItem.vue b/app/javascript/dashboard/components/helpCenter/ArticleItem.vue new file mode 100644 index 000000000..697fcfeee --- /dev/null +++ b/app/javascript/dashboard/components/helpCenter/ArticleItem.vue @@ -0,0 +1,116 @@ + + + + + + + + {{ title }} + + + {{ $t('HELP_CENTER.TABLE.COLUMNS.BY') }} + {{ articleAuthorName }} + + + + + {{ category }} + {{ readCount }} + + + + {{ lastUpdatedAt }} + + + + + + diff --git a/app/javascript/dashboard/i18n/locale/en/helpCenter.json b/app/javascript/dashboard/i18n/locale/en/helpCenter.json index 041ed6a04..3605814c6 100644 --- a/app/javascript/dashboard/i18n/locale/en/helpCenter.json +++ b/app/javascript/dashboard/i18n/locale/en/helpCenter.json @@ -14,6 +14,11 @@ "CLOSE_SIDEBAR": "Close sidebar", "SAVING": "Draft saving...", "SAVED": "Draft saved" + }, + "TABLE": { + "COLUMNS": { + "BY": "by" + } } } }