2024-04-15 07:19:14 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
import { TIssue } from "@plane/types";
|
|
|
|
import { Input } from "@plane/ui";
|
|
|
|
|
|
|
|
type TInboxIssueTitle = {
|
|
|
|
data: Partial<TIssue>;
|
|
|
|
handleData: (issueKey: keyof Partial<TIssue>, issueValue: Partial<TIssue>[keyof Partial<TIssue>]) => void;
|
2024-04-24 09:47:50 +00:00
|
|
|
isTitleLengthMoreThan255Character?: boolean;
|
2024-04-15 07:19:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const InboxIssueTitle: FC<TInboxIssueTitle> = observer((props) => {
|
2024-04-24 09:47:50 +00:00
|
|
|
const { data, handleData, isTitleLengthMoreThan255Character } = props;
|
2024-04-15 07:19:14 +00:00
|
|
|
|
|
|
|
return (
|
2024-05-07 07:14:36 +00:00
|
|
|
<div className="space-y-1">
|
2024-04-15 07:19:14 +00:00
|
|
|
<Input
|
|
|
|
id="name"
|
|
|
|
name="name"
|
|
|
|
type="text"
|
|
|
|
value={data?.name}
|
|
|
|
onChange={(e) => handleData("name", e.target.value)}
|
|
|
|
placeholder="Title"
|
2024-05-07 07:14:36 +00:00
|
|
|
className="w-full text-base"
|
2024-04-15 14:15:47 +00:00
|
|
|
required
|
2024-04-15 07:19:14 +00:00
|
|
|
/>
|
2024-04-24 09:47:50 +00:00
|
|
|
{isTitleLengthMoreThan255Character && (
|
|
|
|
<span className="text-xs text-red-500">Title should be less than 255 characters</span>
|
|
|
|
)}
|
2024-04-15 07:19:14 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
});
|