Closed otto-jacob closed 1 year ago
Hello human! 👋
This PR was created by Otto to address the issue Create src/components/SitemapDiagram.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 7, 2023 4:54pm |
Summary:
Create a React component for src/components/SitemapDiagram.tsx. Here are the instructions:
Issue: Create SitemapDiagram.tsx React component for displaying sitemap diagram
Background
We need to create a new React component called
SitemapDiagram.tsx
that will be responsible for displaying the sitemap diagram of a project. This component will be used on the project sitemap page to provide a visual representation of the files in the project directory. The component should be written in TypeScript using ES6 syntax, such as arrow functions, and styled using Tailwind CSS.Task
Create a new React component called
SitemapDiagram.tsx
in thesrc/components
directory. This component should accept a single prop calledsitemapItems
of typeProjectSitemap[]
(imported from thetypes.ts
file).Instructions
In the
src/components
directory, create a new file calledSitemapDiagram.tsx
.Import the necessary dependencies at the top of the file:
Define the
Props
interface for this component:Create the
SitemapDiagram
functional component with the following structure:Inside the component, map over the
sitemapItems
prop to create an array of JSX elements representing each file in the sitemap. Each element should include the file name, file description, and an optional Figma URL if provided. Style the elements using Tailwind CSS classes.Render the
sitemapElements
array inside a wrappingdiv
element with appropriate styling. If there are no sitemap items, display a message indicating that no items have been added yet.Make sure to use only Tailwind CSS classes for styling and do not import any CSS files directly or create custom CSS classes.
Testing
Once the component is created, import it into the project sitemap page and pass the
sitemapItems
prop with sample data to ensure it renders correctly and displays the sitemap diagram as expected.Acceptance Criteria
SitemapDiagram.tsx
component is created in thesrc/components
directory.sitemapItems
prop of typeProjectSitemap[]
.sitemapItems
prop and creates an array of JSX elements representing each file in the sitemap.