Sources.purs 651 Bytes
Newer Older
Sudhir Kumar's avatar
Sudhir Kumar committed
1
module Gargantext.Pages.Corpus.Doc.Facets.Sources where
2 3


Abinaya Sudhir's avatar
Abinaya Sudhir committed
4
import Data.Array (fold)
5
import Gargantext.Pages.Corpus.Doc.Facets.Documents as D
6
import Prelude hiding (div)
Abinaya Sudhir's avatar
Abinaya Sudhir committed
7
import React.DOM (h3, text)
8
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
9

Abinaya Sudhir's avatar
Abinaya Sudhir committed
10
type State = D.State
11 12


Abinaya Sudhir's avatar
Abinaya Sudhir committed
13
initialState :: D.State
14
initialState = D.initialState
15

Abinaya Sudhir's avatar
Abinaya Sudhir committed
16
type Action = D.Action
17 18


19
sourceSpec :: Spec State {} Action
Abinaya Sudhir's avatar
Abinaya Sudhir committed
20
sourceSpec = simpleSpec defaultPerformAction render
21
  where
22
    render :: Render State {} Action
23
    render dispatch _ state _ =
Abinaya Sudhir's avatar
Abinaya Sudhir committed
24 25
      [ h3 [] [text "Source view"]]

26
sourcespec' :: Spec State {} Action
Abinaya Sudhir's avatar
Abinaya Sudhir committed
27
sourcespec' = fold [sourceSpec, D.layoutDocview]