Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

820 B
Raw Blame
import type { ChakraProps, StatProps } from '@invoke-ai/ui-library';
import { Stat, StatLabel, StatNumber } from '@invoke-ai/ui-library';
import { memo } from 'react';

const sx: ChakraProps['sx'] = {
  '&[aria-disabled="true"]': {
    color: 'base.500',
  },
};

type Props = Omit<StatProps, 'children'> & {
  label: string;
  value: string | number;
  isDisabled?: boolean;
};

const StatusStatItem = ({ label, value, isDisabled = false, ...rest }: Props) => (
  <Stat
    flexGrow={1}
    textOverflow="ellipsis"
    overflow="hidden"
    whiteSpace="nowrap"
    aria-disabled={isDisabled}
    sx={sx}
    {...rest}
  >
    <StatLabel textOverflow="ellipsis" overflow="hidden" whiteSpace="nowrap">
      {label}
    </StatLabel>
    <StatNumber>{value}</StatNumber>
  </Stat>
);

export default memo(StatusStatItem);