import {FC, useEffect, useState} from "react";
import {View} from "@tarojs/components";
import {Search} from "./components/search";
import {CourseAllParam, courseApi} from "@/api";

const CourseAdmin: FC = () => {
  const [param, setParam] = useState<CourseAllParam>({
    page: 1,
    page_size: 10,
    title: '',
    dep_id: 0
  })

  useEffect(() => {
    courseApi.getCourseAll(param)
  }, [param])

  return (
    <View>
      <Search param={param} setParam={setParam}/>
    </View>
  )
}

export default CourseAdmin
