Files
Dwinzo_dev/app/src/components/ui/componets/functions/getActiveProperties.ts

18 lines
422 B
TypeScript
Raw Normal View History

export const getActiveProperties = (position: {
top: number | "auto";
left: number | "auto";
right: number | "auto";
bottom: number | "auto";
}) => {
let activeProps: ["top", "left"] | ["bottom", "right"] = ["top", "left"]; // Default to top-left
if (
typeof position.bottom !== "string" &&
typeof position.right !== "string"
) {
activeProps = ["bottom", "right"];
}
return activeProps;
};