import {PreviewComponent} from './preview-component'; import {ThemeSelect} from './theme-select'; export const CategoryPage = { props: ['components', 'categories', 'id', 'query'], template: `

{{category.name}} Components

`, components: { 'css-component': PreviewComponent, 'theme-select': ThemeSelect }, computed: { category() { return this.categories.filter(category => category.hash === this.id)[0]; } }, methods: { filterComponents() { const category = this.category; const components = this.components.filter(component => { return component.category === category.name; }); return components; }, } };