front_gestalt/components/info-item.tsx

31 lines
1.5 KiB
TypeScript
Raw Permalink Normal View History

2025-01-09 00:40:28 +03:00
import React from 'react';
import Image from "next/image";
interface Props {
name: string;
2025-01-27 22:42:23 +03:00
variable?: 'default' | 'lg' | 'secondary' | 'white' | 'lgFixed' | 'whiteFixed' | 'lgDefault';
2025-01-09 00:40:28 +03:00
pathImg?: string;
}
const InfoItem: React.FC<Props> = ({name, variable = 'default', pathImg}) => {
const variantClasses = {
2025-01-27 22:42:23 +03:00
default: 'text-[13px] px-[9.5px] rounded-[6px] border-[0.5px] text-blue font-[400] min-h-[28px] max-h-[28px] h-full',
2025-01-14 18:28:14 +03:00
secondary: 'text-[16px] text-lightBlack border-[1px] rounded-[6px] py-[10px] px-[28px] gap-[10px] items-center',
lg: 'px-[10px] py-[6.5px] rounded-[6px] border-[1px] text-[16px] text-blue font-[700]',
2025-01-27 22:42:23 +03:00
lgDefault: 'text-[14px] px-[9.5px] rounded-[6px] border-[0.5px] text-blue font-[400] max-w-[114px] w-full min-h-[34px] h-full',
2025-01-09 00:40:28 +03:00
lgFixed: 'px-[10px] py-[6.5px] max-w-[140px] w-full rounded-[6px] border-[1px] text-[16px] text-blue',
2025-01-14 18:28:14 +03:00
white: 'text-[12px] py-[9px] px-[16px] text-blue bg-white rounded-[6px]',
whiteFixed: 'tex-[14px] rounded-[6px] max-w-[114px] w-full bg-white py-[5px] text-blue font-[700]'
2025-01-09 00:40:28 +03:00
};
const selectedVariantClasses = variantClasses[variable] || variantClasses.default;
return (
2025-01-14 18:28:14 +03:00
<div className={`flex items-center justify-center font-[400] border-blue w-fit ${selectedVariantClasses}`}>
2025-01-09 00:40:28 +03:00
{pathImg && <Image src={`/images/${pathImg}.svg`} alt={pathImg} width={18} height={18} />}
2025-01-14 18:28:14 +03:00
<span className="relative top-[2px]">{name}</span>
</div>
2025-01-09 00:40:28 +03:00
);
}
export default InfoItem