Closed otto-jacob closed 1 year ago
Hello human! 👋
This PR was created by Otto to address the issue Create src/components/ProjectCard.tsx
Please review the PR carefully. Auto-generated code can and will contain subtle bugs and mistakes.
If you identify code that needs to be changed, please reject the PR with a specific reason. Be as detailed as possible in your comments. Otto will take these comments, make changes to the code and push up changes. Please note that this process will take a few minutes.
Once the code looks good, approve the PR and merge the code.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
otto-playground | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 6, 2023 11:22pm |
Summary:
Create a React component for src/components/ProjectCard.tsx. Here are the instructions:
Issue: Create ProjectCard.tsx React component for displaying project information
Description
We need to create a new React component called
ProjectCard.tsx
that will be responsible for displaying project information in a card format. This component will be used in the main dashboard page to show a list of all the current projects that the user is working on. The component should be written in TypeScript using ES6 syntax, such as arrow functions, and styled using Tailwind CSS.Requirements
ProjectCard.tsx
in thesrc/components
directory.import React from 'react';
import { Project } from '~/types';
Props
interface for this component. It should have a single property calledproject
of typeProject
(imported fromtypes.ts
).ProjectCard
that accepts theProps
interface as its props.project
prop to extract the necessary properties:name
,description
, andcreatedAt
.text-xl font-bold
), the description should be displayed as a paragraph (e.g., usingtext-base
), and the creation date should be displayed as a smaller text (e.g., usingtext-sm text-gray-500
).div
element with appropriate Tailwind CSS classes for the card container.div
, render anh2
element with the project name.h2
element, render ap
element with the project description.p
element, render aspan
element with the formatted creation date (e.g., "Created on MM/DD/YYYY").ProjectCard
component as the default export.Example usage
The
ProjectCard
component should be used like this:Notes
~
for the root directory (src). The tsconfig paths configuration is{"~/*": ["./src/*"]}
.Please let me know if you have any questions or need further clarification.