import React, { type FC, type AnchorHTMLAttributes } from 'react';
import useThemeConfig from '../../hooks/useThemeConfig';
import { Stack, Button, Icon, Image } from '@chakra-ui/react';
import { VscGithub as Github } from 'react-icons/vsc';
import { SiDiscord as Discord } from 'react-icons/si';
/**
* @description social type enum
*/
export enum SOCIALS {
/**
* github
*/
GITHUB = 'github',
/**
* discord
*/
DISCORD = 'discord'
}
export type Socials = 'github' | 'discord' | string;
/**
* @description social item config
*/
export type SocialItem = {
/**
* @descripion alt or label message
*/
name: string;
/**
* @description element a href sources
*/
link: string;
/**
* @description custom icon url
*/
icon?: string;
/**
* @description anchor open way
* @default __blank
*/
target?: AnchorHTMLAttributes['target'];
};
export type SocialMap = Partial>;
const Social: FC = () => {
const themeConfig = useThemeConfig();
const social = themeConfig.social;
if (!social || !Object.keys(social).length) return null;
return (
{Object.entries(social).map(([type, socialItem]) => {
const { name, link, target = '__blank', icon } = socialItem!;
const socialIcon =
type === 'github' ? (
) : type === 'discord' ? (
) : null;
return (
);
})}
);
};
export default Social;