planmymeal/utils/directional-icon.ts

19 lines
563 B
TypeScript
Raw Permalink Normal View History

import {
RiArrowLeftLine,
RiArrowLeftSLine,
RiArrowRightLine,
RiArrowRightSLine,
RiSidebarFoldLine,
RiSidebarUnfoldLine,
} from "@remixicon/react";
/** Navigation glyphs mirror; logos, media controls and trend arrows do not. */
const directionalIcons: ReadonlySet<unknown> = new Set([
RiArrowLeftLine, RiArrowLeftSLine, RiArrowRightLine, RiArrowRightSLine,
RiSidebarFoldLine, RiSidebarUnfoldLine,
]);
export function directionalIconClass(icon: unknown): string | undefined {
return directionalIcons.has(icon) ? "rtl:rotate-180" : undefined;
}