Copilot commented on code in PR #3098:
URL: https://github.com/apache/apisix-dashboard/pull/3098#discussion_r2125760500


##########
src/components/form-slice/FormSectionGeneral.tsx:
##########
@@ -46,13 +46,14 @@ const FormItemID = () => {
 };
 
 export type FormSectionGeneralProps = {
+  /** will be default to `!readOnly` */
   showDate?: boolean;
   showID?: boolean;
   readOnly?: boolean;
 };
 
 export const FormSectionGeneral = (props: FormSectionGeneralProps) => {
-  const { showDate = true, showID = true, readOnly = false } = props;
+  const { showDate = props.readOnly, showID = true, readOnly = false } = props;

Review Comment:
   The default for `showDate` is inverted: it’s set to `props.readOnly` but 
should default to `!props.readOnly` so the date is hidden in read-only mode.
   ```suggestion
     const { showDate = !props.readOnly, showID = true, readOnly = false } = 
props;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to