2026-08-02 19:33:13 -04:00
|
|
|
import { useMatch } from 'react-router';
|
2024-05-31 19:49:46 +05:30
|
|
|
import { getDirectCreatePath, getDirectPath } from '../../pages/pathUtils';
|
|
|
|
|
|
|
|
|
|
export const useDirectSelected = (): boolean => {
|
|
|
|
|
const directMatch = useMatch({
|
|
|
|
|
path: getDirectPath(),
|
|
|
|
|
caseSensitive: true,
|
|
|
|
|
end: false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return !!directMatch;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const useDirectCreateSelected = (): boolean => {
|
|
|
|
|
const match = useMatch({
|
|
|
|
|
path: getDirectCreatePath(),
|
|
|
|
|
caseSensitive: true,
|
|
|
|
|
end: false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return !!match;
|
|
|
|
|
};
|