<script>
import Header from './Header.svelte'
import Table from './Table.svelte'
import Footer from './Footer.svelte'
export var key = 'AIzaSyA3TXkBfYXsotsjOk0kW6rctz3JOL52Uec'
export var lang = 'en'
var tableData = {}
getData()
function getData () {
var spreadsheetId = '16cflYHEYotn2cPK_jTcLnbyaKlUxp-KOwG0NCWQ--lI'
var url = 'https://sheets.googleapis.com/v4/spreadsheets/' + spreadsheetId + '/values/' + lang + '!A1:F?key=' + key
var request = new XMLHttpRequest();
request.open('GET', url, true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
var data = JSON.parse(request.responseText)
if (data.values) {
tableData = {
header: data.values.slice(0,1)[0],
footer: data.values.slice(1,2)[0],
thead: data.values.slice(2,4),
tbody: data.values.slice(4)
}
}
} else {
console.warn(request.status)
}
}
request.send();
}