PioneerSquareLabs / otto-playground

A playground where Otto can run free while hopefully not accidentally reformatting your hard drive
https://otto-playground.vercel.app
13 stars 0 forks source link

Create src/components/ProjectCard.tsx #703

Closed kleneway closed 1 year ago

kleneway commented 1 year ago

Summary:

Create a React component for src/components/ProjectCard.tsx. Here are the instructions:

Issue: Create a ProjectCard React Component

Description

We need to create a new React component called ProjectCard.tsx that will be responsible for displaying a project card in our application. This component will be used on the main dashboard page to show the list of projects the user is working on. The component should be written in TypeScript using ES6 syntax, such as arrow functions, and utilize Tailwind CSS for styling.

Requirements

  1. Create a new file ProjectCard.tsx inside the src/components directory.
  2. Import the necessary dependencies:
    • React from 'react'
    • Project type from ~/types
  3. Define a Props interface for this component that includes the following properties:
    • project: A Project object that represents the project to be displayed in the card.
  4. Create a functional component ProjectCard that accepts the Props interface as its props.
  5. Inside the component, extract the necessary properties from the project prop, such as name, description, and createdAt.
  6. Render a card element using Tailwind CSS classes for styling. The card should have the following structure:
    • A container div with appropriate padding, margin, and border styling.
    • A heading element (e.g., h3) that displays the project name.
    • A paragraph element that displays the project description.
    • A footer element that displays the project creation date in a human-readable format (e.g., "Created on January 1, 2022").
  7. Make sure to apply responsive styles using Tailwind CSS utility classes for different screen sizes.
  8. Export the ProjectCard component as the default export.

Example Usage

Here's an example of how the ProjectCard component will be used:

import ProjectCard from '~/components/ProjectCard';
import { Project } from '~/types';

const project: Project = {
  // ...project data
};

function Dashboard() {
  return (
    <div>
      {/* Other dashboard components */}
      <ProjectCard project={project} />
    </div>
  );
}

Notes

Please submit a pull request with your changes once the component is complete. If you have any questions or need clarification, feel free to reach out.

kleneway commented 1 year ago

Hello human! 👋

This PR was created by Otto to address the issue Create src/components/ProjectCard.tsx

Next Steps

  1. Please review the PR carefully. Auto-generated code can and will contain subtle bugs and mistakes.

  2. 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.

  3. Once the code looks good, approve the PR and merge the code.