import { useParams } from "react-router-dom";

import { NEW_ID } from "../../constants";

export const useCard = () => {
	const { id } = useParams();
	const isNew = id === NEW_ID;
	const modelId = isNew ? undefined : id;

	return {
		isNew,
		modelId,
	};
};