Port ed4788a342a7215ac87b8d34761f0a996c83e699 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
26 lines
663 B
TypeScript
26 lines
663 B
TypeScript
import type { IconName } from './media_icon';
|
|
import { MediaIcon } from './media_icon';
|
|
import { StatusBanner, BannerVariant } from './status_banner';
|
|
|
|
export const ContentWarning: React.FC<{
|
|
text: string;
|
|
expanded?: boolean;
|
|
onClick?: () => void;
|
|
icons?: IconName[];
|
|
}> = ({ text, expanded, onClick, icons }) => (
|
|
<StatusBanner
|
|
expanded={expanded}
|
|
onClick={onClick}
|
|
variant={BannerVariant.Warning}
|
|
>
|
|
{icons?.map((icon) => (
|
|
<MediaIcon
|
|
className='status__content__spoiler-icon'
|
|
icon={icon}
|
|
key={`icon-${icon}`}
|
|
/>
|
|
))}
|
|
<span dangerouslySetInnerHTML={{ __html: text }} />
|
|
</StatusBanner>
|
|
);
|