Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Convert Stitch-generated screens into validated React component systems with design token consistency
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
examples/gold-standard-card.tsx
1/**2* Copyright 2026 Google LLC3*4* Licensed under the Apache License, Version 2.0 (the "License");5* you may not use this file except in compliance with the License.6* You may obtain a copy of the License at7*8* http://www.apache.org/licenses/LICENSE-2.09*10* Unless required by applicable law or agreed to in writing, software11* distributed under the License is distributed on an "AS IS" BASIS,12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13* See the License for the specific language governing permissions and14* limitations under the License.15*/1617import React from 'react';18// Note for Agent: The '@' alias refers to the target project's src directory.19// Ensure src/data/mockData.ts is created before generating this component.20import { cardData } from '../data/mockData';2122/**23* Gold Standard: ActivityCard24* This file serves as the definitive reference for the agent.25*/26interface ActivityCardProps {27readonly id: string;28readonly username: string;29readonly action: 'MERGED' | 'COMMIT';30readonly timestamp: string;31readonly avatarUrl: string;32readonly repoName: string;33}3435export const ActivityCard: React.FC<ActivityCardProps> = ({36username,37action,38timestamp,39avatarUrl,40repoName,41}) => {42const isMerged = action === 'MERGED';4344return (45<div className="flex items-center justify-between gap-4 rounded-lg bg-surface-dark p-4 min-h-14 shadow-sm ring-1 ring-white/10">46<div className="flex items-center gap-4 overflow-hidden">47<div48className="aspect-square h-10 w-10 flex-shrink-0 rounded-full bg-cover bg-center bg-no-repeat"49style={{ backgroundImage: `url(${avatarUrl})` }}50aria-label={`Avatar for ${username}`}51/>5253<div className="flex flex-wrap items-center gap-x-2 gap-y-1 text-sm sm:text-base">54<a href="#" className="font-semibold text-primary hover:underline truncate">55{username}56</a>5758<span className={`inline-block px-2 py-0.5 text-xs font-semibold rounded-full ${isMerged ? 'bg-purple-500/30 text-purple-300' : 'bg-primary/30 text-primary'59}`}>60{action}61</span>6263<span className="text-white/60">in</span>6465<a href="#" className="text-primary hover:underline truncate">66{repoName}67</a>68</div>69</div>7071<div className="shrink-0">72<p className="text-sm font-normal leading-normal text-white/50">73{timestamp}74</p>75</div>76</div>77);78};7980export default ActivityCard;