16 lines
357 B
TypeScript
16 lines
357 B
TypeScript
import { useEffect, useState } from "react";
|
|
import api from "@/api";
|
|
import { InternshipType } from "@/data";
|
|
|
|
export const useInternshipTypes = () => {
|
|
const [types, setTypes] = useState<InternshipType[]>([]);
|
|
|
|
useEffect(() => {
|
|
(async () => {
|
|
setTypes(await api.type.available());
|
|
})()
|
|
}, [])
|
|
|
|
return types;
|
|
}
|