<commit_before>import React from 'react';
import { Docket } from '@urbit/api/docket';
import cn from 'classnames';
import { useTileColor } from '../tiles/useTileColor';

type DocketImageSizes = 'xs' | 'small' | 'default' | 'full';

interface DocketImageProps extends Pick<Docket, 'color' | 'image'> {
  className?: string;
  size?: DocketImageSizes;
}

const sizeMap: Record<DocketImageSizes, string> = {
  xs: 'w-6 h-6 mr-2 rounded',
  small: 'w-8 h-8 mr-3 rounded-md',
  default: 'w-12 h-12 mr-3 rounded-lg',
  full: 'w-20 h-20 md:w-32 md:h-32 rounded-2xl'
};

export function DocketImage({ color, image, className = '', size = 'full' }: DocketImageProps) {
  const { tileColor } = useTileColor(color);
  return (
    <div
      className={cn('flex-none relative bg-gray-200 overflow-hidden', sizeMap[size], className)}
      style={{ backgroundColor: tileColor }}
    >
      {image && (
        <img className="absolute top-0 left-0 h-full w-full object-contain" src={image} alt="" />
      )}
    </div>
  );
}<commit_msg>grid: match docket image to tile image<commit_after>import React from 'react';
import { Docket } from '@urbit/api/docket';
import cn from 'classnames';
import { useTileColor } from '../tiles/useTileColor';

type DocketImageSizes = 'xs' | 'small' | 'default' | 'full';

interface DocketImageProps extends Pick<Docket, 'color' | 'image'> {
  className?: string;
  size?: DocketImageSizes;
}

const sizeMap: Record<DocketImageSizes, string> = {
  xs: 'w-6 h-6 mr-2 rounded',
  small: 'w-8 h-8 mr-3 rounded-md',
  default: 'w-12 h-12 mr-3 rounded-lg',
  full: 'w-20 h-20 md:w-32 md:h-32 rounded-2xl'
};

export function DocketImage({ color, image, className = '', size = 'full' }: DocketImageProps) {
  const { tileColor } = useTileColor(color);
  return (
    <div
      className={cn('flex-none relative bg-gray-200 overflow-hidden', sizeMap[size], className)}
      style={{ backgroundColor: tileColor }}
    >
      {image && (
        <img className="absolute top-0 left-0 h-full w-full object-cover" src={image} alt="" />
      )}
    </div>
  );
}
{'fraction_non_alphanumeric': 0.16417910447761194, 'fraction_numerical': 0.02407318247472316, 'mean_word_length': 3.6487695749440716, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5756953', 'n_tokens_mistral': 738, 'n_tokens_neox': 707, 'n_words': 188}