Skip to content

Commit

Permalink
implement new table variant
Browse files Browse the repository at this point in the history
  • Loading branch information
vraja-pro committed Jan 15, 2025
1 parent 423ee4a commit ec8b1b1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/js/src/dashboard/components/dashboard.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Scores } from "../scores/components/scores";
import { PageTitle } from "./page-title";
import { DashboardTable } from "./dashboard-table";

/**
* @type {import("../index").ContentType} ContentType
Expand All @@ -18,10 +19,27 @@ import { PageTitle } from "./page-title";
* @returns {JSX.Element} The element.
*/
export const Dashboard = ( { contentTypes, userName, features, endpoints, headers, links } ) => {
const columns = [
{ name: "landing-page", label: "Landing page" },
{ name: "clicks", label: "Clicks", sortable: true },
{ name: "impressions", label: "Impressions" },
{ name: "ctr", label: "CTR" },
{ name: "average-position", label: "Average position" },
{ name: "seo-score", label: "SEO score", className: "yst-flex yst-justify-end yst-text-center" },
];

const data = [
[ "https://example.com1", 10, 1001, 10, 1, "good" ],
[ "https://example.com2", 90, 1002, 9, 3, "bad" ],
[ "https://example.com3", 50, 1003, 8, 5, "good" ],
[ "https://example.com4", 0, 1004, 7, 2, "ok" ],
[ "https://example.com5", 70, 1005, 6, 4, "ok" ],
];
return (
<>
<PageTitle userName={ userName } features={ features } links={ links } />
<div className="yst-flex yst-flex-col @7xl:yst-flex-row yst-gap-6 yst-my-6">
<DashboardTable title="Test Table" columns={ columns } data={ data } />
{ features.indexables && features.seoAnalysis && (
<Scores analysisType="seo" contentTypes={ contentTypes } endpoint={ endpoints.seoScores } headers={ headers } />
) }
Expand Down

0 comments on commit ec8b1b1

Please sign in to comment.