I want to add this library to my nextjs with ts but I get the next error :
Server Error
SyntaxError: Cannot use import statement outside a module
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
import React, { useState } from 'react';
import CalendarTemplate from 'availability-calendar-react';
import dynamic from 'next/dynamic'
const Page: React.FC = () => {
const [availability, setAvailability] = useState([])
const Calendar = CalendarTemplate({
availability,
setAvailability
})
return (
<div>
<Calendar />
</div>
);
};
export default Page;
For reference I am using this dashboard I am getting the error when i refresh the page