pleroma/packages/pl-fe/src/components/fork-awesome-icon.tsx
marcin mikołajczak 966b04fdf0 Call it pl-fe internally
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:41:08 +02:00

34 lines
995 B
TypeScript

/**
* ForkAwesomeIcon: renders a ForkAwesome icon.
* Full list: https://forkaweso.me/Fork-Awesome/icons/
* @module pl-fe/components/fork_awesome_icon
* @see pl-fe/components/icon
*/
import clsx from 'clsx';
import React from 'react';
interface IForkAwesomeIcon extends React.HTMLAttributes<HTMLLIElement> {
id: string;
className?: string;
fixedWidth?: boolean;
}
const ForkAwesomeIcon: React.FC<IForkAwesomeIcon> = ({ id, className, fixedWidth, ...rest }) => {
// Use the Fork Awesome retweet icon, but change its alt
// tag. There is a common adblocker rule which hides elements with
// alt='retweet' unless the domain is twitter.com. This should
// change what screenreaders call it as well.
// const alt = (id === 'retweet') ? 'repost' : id;
return (
<i
role='img'
// alt={alt}
className={clsx('fa', `fa-${id}`, className, { 'fa-fw': fixedWidth })}
{...rest}
/>
);
};
export { type IForkAwesomeIcon, ForkAwesomeIcon as default };