import type { PropertiesHyphen } from "csstype" ; import { useTextDirection } from "./useTextDirection" ; import { supportsProperty } from "./utils" ; export function useLogicalInlineCSSProperty ( propertyGroup , ref ) { const startProperty = `${ propertyGroup }-inline-start` as keyof PropertiesHyphen ; const endProperty = `${ propertyGroup }-inline-end` as keyof PropertiesHyphen ; if ( supportsProperty ( endProperty ) ) return [ startProperty , endProperty ] ; let leftProperty = "left" ; let rightProperty = "right" ; if ( propertyGroup !== "inset" ) { leftProperty = `${ propertyGroup }-${ leftProperty }` as keyof PropertiesHyphen ; rightProperty = `${ propertyGroup }-${ rightProperty }` as keyof PropertiesHyphen ; } return ( useTextDirection ( ref ) === "rtl" ? [ rightProperty , leftProperty ] : [ leftProperty , rightProperty ] ) ; }