21 lines
760 B
TypeScript
21 lines
760 B
TypeScript
import Button from "../../../../components/ui/Button/Button";
|
|
import styles from "../../HomePage.module.css"
|
|
import { useContext } from "react";
|
|
import { AuthContext, AuthContextType } from "../../../../contexts/Auth/AuthContext";
|
|
import { APP_CONFIG } from "../../../../config/appConfig";
|
|
|
|
export default function ExportBtn() {
|
|
|
|
const { user } = useContext(AuthContext) as AuthContextType;
|
|
const calendarUrl = `${import.meta.env.VITE_API_URL}/api/export/ics/${user?.id}`;
|
|
|
|
return <Button className={styles.exportbtn}
|
|
onClick={() => {
|
|
window.open(
|
|
`${APP_CONFIG.newCalendarURL}${calendarUrl}`
|
|
);
|
|
}}
|
|
>
|
|
Exporter
|
|
</Button>
|
|
} |