plane/apps/app/components/pages/page-label.tsx
Saheb Giri 4a81b988b4
feat: implemented new pages design with bare minimum functionality (#503)
* chore: add page types and page api service

* chore: add create, list, update and delete on pages

* chore: add create, delete and patch page blocks

* feat: add and remove pages to favorite

* fix: made neccessary changes

- used tailwind for hover events
- add error toast alert
- used partial for patch request

* fix: replace absolute positiong with a flex box

* fix: design list page view to match with ui

* feat: add top large textarea for page title and description

* refactor: add page label with types

* feat: add pages grid layout

* feat: add tabs and masonry layout

* fix: build errors

---------

Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
2023-03-23 16:12:14 +05:30

24 lines
540 B
TypeScript

import React from "react";
type TLabelProps = {
variant: "red" | "blue" | string;
children?: React.ReactNode;
};
const Label: React.FC<TLabelProps> = (props) => {
let color = "bg-green-100 text-green-800";
if (props.variant === "red") {
color = "bg-red-100 text-red-800";
} else if (props.variant === "blue") {
color = "bg-blue-100 text-blue-800";
}
return (
<p className={`inline-flex rounded-full px-2 text-xs font-semibold leading-5 ${color}`}>
{props.children}
</p>
);
};
export default Label;