// export default '/actor/edit/@actorId/*';
// import { redirect } from 'vike/abort'; /* eslint-disable-line import/extensions */
import { match } from 'path-to-regexp';

const path = '/actor/edit/:actorId/:actorSlug?';
const urlMatch = match(path, { decode: decodeURIComponent });

export default (pageContext) => {
	const matched = urlMatch(pageContext.urlPathname);

	if (matched) {
		return {
			routeParams: matched.params.actorId
				? {
						actorId: matched.params.actorId,
					}
				: {},
		};
	}

	return false;
};
