/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React, {memo} from 'react'; import clsx from 'clsx'; import Image from '@theme/IdealImage'; import Link from '@docusaurus/Link'; import styles from './styles.module.css'; import FavoriteIcon from '@site/src/components/svgIcons/FavoriteIcon'; import Tooltip from '@site/src/components/showcase/ShowcaseTooltip'; import {Tags, TagList, TagType, User, Tag} from '@site/src/data/users'; import {sortBy} from '@site/src/utils/jsUtils'; interface Props extends Tag { id: string; } const TagComp = React.forwardRef( ({id, label, color, description}, ref) => (
  • {label.toLowerCase()}
  • ), ); function ShowcaseCardTag({tags}: {tags: TagType[]}) { const tagObjects = tags.map((tag) => ({tag, ...Tags[tag]})); // Keep same order for all tags const tagObjectsSorted = sortBy(tagObjects, (tagObject) => TagList.indexOf(tagObject.tag), ); return ( <> {tagObjectsSorted.map((tagObject, index) => { const id = `showcase_card_tag_${tagObject.tag}`; return ( ); })} ); } const ShowcaseCard = memo(({user}: {user: User}) => (
  • {user.title}

    {user.title}

    {user.tags.includes('favorite') && ( )} {user.source && ( source )}

    {user.description}

  • )); export default ShowcaseCard;