Closed kleneway 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.
Summary:
Create a React component for src/components/ProjectCard.tsx. Here are the instructions:
Issue: Create ProjectCard.tsx React component for displaying project information
Background
We need a new React component called
ProjectCard.tsx
to display project information in a card format. This component will be used on the main dashboard page to show a list of all the current projects that the user is working on.Task
Create a new React component called
ProjectCard.tsx
using TypeScript and ES6 syntax (arrow functions). This component should accept necessary props to display the project information and use Tailwind CSS for styling.Requirements
Create a new file
ProjectCard.tsx
in thesrc/components
directory.Import the necessary dependencies at the top of the file:
FC
type from 'react'.Project
type from thetypes.ts
file. Use the following import statement:Define the
Props
interface for this component. It should have a single propertyproject
of typeProject
.Create a functional component
ProjectCard
with the following structure:FC
type from 'react' and theProps
interface for typing the component.project
prop from the props.bg-white shadow-md rounded-lg p-4
as the main container.h2
element with the classtext-xl font-semibold mb-2
for the project name. Use theproject.name
property as the content.p
element with the classtext-gray-600
for the project description. Use theproject.description
property as the content. If the description is not available, display the text "No description provided."Export the
ProjectCard
component as the default export.Example usage
The
ProjectCard
component will be used like this:Notes
~
for the root directory (src). The tsconfig paths configuration is{"~/*": ["./src/*"]}
.