import { ComponentType } from "react";
import { RouteComponentProps } from "wouter";

interface RouteWithPath {
	path: string;
	nest?: RoutingTree;
}
interface RouteWithoutPath {
	path?: never;
	nest?: never;
}
interface RouteWithComponent {
	nest?: never;
	component: ComponentType<RouteComponentProps<{}>> | undefined;
}
interface RouteWithoutComponent {
	nest: RoutingTree;
	component?: never;
}
interface RouteObjectBase {
	name: string;
	icon?: React.FC;
}
export type RouteObject = RouteObjectBase &
	(RouteWithPath | RouteWithoutPath) &
	(RouteWithComponent | RouteWithoutComponent);

export type RoutingTree = RouteObject[];
