open-index/open-npm huggingface dataset:
npm package: @skillsuite/course-viewer
Description: SkillSuite Course Viewer Package
Author: Lucas Craveiro Paes
Latest version: 2.0.0

# SkillSuite - Course Viewer

This is a package to embed our course viewer feature into your own React project. It's simple, and you don't need third party libraries.

## Scripts

| Command | Description |
| :------------- | :------------- |
| ```npm run start``` | Start development server |
| ```npm run build``` | Start build script |

## Example

```js
import CourseViewer, { config, client } from "@skillsuite/course-viewer";

config.log = console.log;
config.baseURL = "htttp://myhost.com.br";

const App = () => {
  const [ overview, setOverview ] = useState(null);

  const onSection = async ({ section }) => await client.get("/api/v3/course_viewer/section/" + section);
  const onQuiz = async ({ quiz }) => await client.get("/api/v3/course_viewer/form/" + quiz);

  useEffect(() => {
    client.get("/api/v3/course_viewer/" + 1695).then(setOverview);
  }, []);

  return (
    <CourseViewer
      overview={ overview }
      onSection={ onSection }
      onQuiz={ onQuiz }
    />
  )
}
```

## Props

| name       | description    |
| :--------- | :------------- |
| ```overview``` | Object with course basic info |
| ```onSection``` | Callback to return the data from specific section |
| ```onQuiz``` | Callback to return the data from specific quiz |