1- import { NamedNode , IndexedFormula } from 'rdflib' ;
2- import { getContents , getSetContentsStatements } from './data' ;
3-
4- export function view (
5- container : HTMLElement ,
6- subject : NamedNode ,
7- store : IndexedFormula ,
8- user ?: NamedNode
9- ) {
1+ import { getContents , getSetContentsStatements } from './data'
2+ import { ViewParams } from '../types'
3+
4+ export function view ( { container, subject, store, user } : ViewParams ) {
105 toViewMode ( )
116
12- function toViewMode ( ) {
7+ function toViewMode ( ) {
138 const content = getContents ( store , subject )
14- container . innerHTML = '' ;
9+ container . innerHTML = ''
1510
1611 const lines = content . split ( '\n' )
1712 lines . forEach ( ( line ) => {
@@ -30,13 +25,13 @@ export function view(
3025 }
3126 }
3227
33- function toEditMode ( ) {
28+ function toEditMode ( ) {
3429 if ( ! user ) {
3530 return
3631 }
3732
3833 const content = getContents ( store , subject )
39- container . innerHTML = '<form><textarea></textarea><button type="submit">Save</button></form>' ;
34+ container . innerHTML = '<form><textarea></textarea><button type="submit">Save</button></form>'
4035
4136 const textArea = container . getElementsByTagName ( 'textarea' ) [ 0 ]
4237 textArea . textContent = content
0 commit comments