index.tsx 755 B

123456789101112131415161718192021222324252627
  1. 'use client'
  2. import React, { FC } from 'react'
  3. import cn from 'classnames'
  4. import { appDefaultIconBackground } from '@/config/index'
  5. import AppIcon from '@/app/components/base/app-icon'
  6. export interface IAppInfoProps {
  7. className?: string
  8. icon: string
  9. icon_background?: string
  10. name: string
  11. }
  12. const AppInfo: FC<IAppInfoProps> = ({
  13. className,
  14. icon,
  15. icon_background,
  16. name
  17. }) => {
  18. return (
  19. <div className={cn(className, 'flex items-center space-x-3')}>
  20. <AppIcon size="small" icon={icon} background={icon_background || appDefaultIconBackground} />
  21. <div className='w-0 grow text-sm font-semibold text-gray-800 overflow-hidden text-ellipsis whitespace-nowrap'>{name}</div>
  22. </div>
  23. )
  24. }
  25. export default React.memo(AppInfo)