// @flow import * as React from 'react'; import styled from 'styled-components'; import Abstract from './Abstract'; import Airtable from './Airtable'; import Codepen from './Codepen'; import Figma from './Figma'; import Framer from './Framer'; import Gist from './Gist'; import GoogleDocs from './GoogleDocs'; import GoogleSheets from './GoogleSheets'; import GoogleSlides from './GoogleSlides'; import InVision from './InVision'; import Loom from './Loom'; import Lucidchart from './Lucidchart'; import Marvel from './Marvel'; import Mindmeister from './Mindmeister'; import Miro from './Miro'; import ModeAnalytics from './ModeAnalytics'; import Prezi from './Prezi'; import Spotify from './Spotify'; import Trello from './Trello'; import Typeform from './Typeform'; import Vimeo from './Vimeo'; import YouTube from './YouTube'; function matcher(Component) { return (url: string) => { const regexes = Component.ENABLED; for (const regex of regexes) { const result = url.match(regex); if (result) { return result; } } }; } const Img = styled.img` margin: 4px; width: 18px; height: 18px; `; export default [ { title: 'Abstract', keywords: 'design', icon: () => , component: Abstract, matcher: matcher(Abstract), }, { title: 'Airtable', keywords: 'spreadsheet', icon: () => , component: Airtable, matcher: matcher(Airtable), }, { title: 'Codepen', keywords: 'code editor', icon: () => , component: Codepen, matcher: matcher(Codepen), }, { title: 'Figma', keywords: 'design svg vector', icon: () => , component: Figma, matcher: matcher(Figma), }, { title: 'Framer', keywords: 'design prototyping', icon: () => , component: Framer, matcher: matcher(Framer), }, { title: 'GitHub Gist', keywords: 'code', icon: () => , component: Gist, matcher: matcher(Gist), }, { title: 'Google Docs', icon: () => , component: GoogleDocs, matcher: matcher(GoogleDocs), }, { title: 'Google Sheets', keywords: 'excel spreadsheet', icon: () => , component: GoogleSheets, matcher: matcher(GoogleSheets), }, { title: 'Google Slides', keywords: 'presentation slideshow', icon: () => , component: GoogleSlides, matcher: matcher(GoogleSlides), }, { title: 'InVision', keywords: 'design prototype', icon: () => , component: InVision, matcher: matcher(InVision), }, { title: 'Loom', keywords: 'video screencast', icon: () => , component: Loom, matcher: matcher(Loom), }, { title: 'Lucidchart', keywords: 'chart', icon: () => , component: Lucidchart, matcher: matcher(Lucidchart), }, { title: 'Marvel', keywords: 'design prototype', icon: () => , component: Marvel, matcher: matcher(Marvel), }, { title: 'Mindmeister', keywords: 'mindmap', icon: () => , component: Mindmeister, matcher: matcher(Mindmeister), }, { title: 'Miro', keywords: 'whiteboard', icon: () => , component: Miro, matcher: matcher(Miro), }, { title: 'Mode', keywords: 'analytics', icon: () => , component: ModeAnalytics, matcher: matcher(ModeAnalytics), }, { title: 'Prezi', keywords: 'presentation', icon: () => , component: Prezi, matcher: matcher(Prezi), }, { title: 'Spotify', keywords: 'music', icon: () => , component: Spotify, matcher: matcher(Spotify), }, { title: 'Trello', keywords: 'kanban', icon: () => , component: Trello, matcher: matcher(Trello), }, { title: 'Typeform', keywords: 'form survey', icon: () => , component: Typeform, matcher: matcher(Typeform), }, { title: 'Vimeo', keywords: 'video', icon: () => , component: Vimeo, matcher: matcher(Vimeo), }, { title: 'YouTube', keywords: 'google video', icon: () => , component: YouTube, matcher: matcher(YouTube), }, ];