import { useState } from 'react'
import { useSelector } from 'react-redux';
import styled from 'styled-components'
import './App.css'

import Template from './Template'
import Editor from './Editor'

const Container = styled.div`
  display: flex;
`

function App() {
  const [target, setTarget] = useState("main");

  const database = useSelector((state) => state.database.value);
  const props = database[target];

  // console.log(database);

  return (
    <Container>
      <Template setTarget={setTarget} props={database} />
      <Editor props={props} />
    </Container>
  )
}

export default App
