Files
ncd-fe/src/components/alt-indicator.tsx
marcin mikołajczak ebb5f30eac GoToSocial: support avatar/header descriptions, RSS fields
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-07-26 14:20:33 +02:00

22 lines
745 B
TypeScript

import clsx from 'clsx';
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { Icon } from './ui';
interface IAltIndicator extends Pick<React.HTMLAttributes<HTMLSpanElement>, 'title' | 'className'> {
warning?: boolean;
}
const AltIndicator: React.FC<IAltIndicator> = ({ className, warning, ...props }) => (
<span
className={clsx('inline-flex items-center gap-1 rounded bg-gray-900 px-2 py-1 text-xs font-medium uppercase text-white', className)}
{...props}
>
{warning && <Icon className='h-4 w-4' src={require('@tabler/icons/outline/alert-triangle.svg')} />}
<FormattedMessage id='upload_form.description_missing.indicator' defaultMessage='Alt' />
</span>
);
export default AltIndicator;