index.tsx 776 B

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