diondiondion f84df36bd1 [Glitch] Update Profile Featured tab to latest designs
Port 05bed6f3d8fc57edfa699e3aac614d2989ef1f73 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2026-04-11 13:26:34 +02:00

43 lines
1.0 KiB
TypeScript

import type { ComponentPropsWithoutRef } from 'react';
import classNames from 'classnames';
import { Link } from 'react-router-dom';
import type { IconProp } from '@/flavours/glitch/components/icon';
import { Icon } from '@/flavours/glitch/components/icon';
import { polymorphicForwardRef } from '@/types/polymorphic';
import classes from './subheading.module.scss';
export const Subheading = polymorphicForwardRef<'h2'>(
({ as: Component = 'h2', children, className, ...props }, ref) => {
return (
<Component
ref={ref}
className={classNames(classes.subheading, className)}
{...props}
>
{children}
</Component>
);
},
);
interface SubheadingLinkProps extends ComponentPropsWithoutRef<typeof Link> {
icon: IconProp;
}
export const SubheadingLink: React.FC<SubheadingLinkProps> = ({
icon,
children,
className,
...props
}) => {
return (
<Link className={classNames(classes.link, className)} {...props}>
<Icon id='subheading-icon' icon={icon} />
{children}
</Link>
);
};