11import { HiArrowLeft } from "react-icons/hi" ;
2- import { Accordion , AccordionItem } from "@nextui-org/react" ;
2+ import { Accordion , AccordionItem , Button } from "@nextui-org/react" ;
3+ import { useState } from "react" ;
4+ import { PaperData } from "../types/types" ;
35
4- export default function EditEntry ( ) {
6+ type PaperProps = {
7+ paperData : PaperData [ ] ;
8+ }
9+
10+ export default function EditEntry ( { paperData } : PaperProps ) {
511 const defaultContent =
612 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." ;
713
14+ const [ papers ] = useState < PaperData [ ] > ( paperData ?? [ ] ) ;
15+ const unresolvedConflicts : string [ ] = [ ] ;
16+
17+ if ( papers . length > 1 ) {
18+ // if all 3 outputs are the same, add nothing to the unresolved conflicts
19+ // if any of 3 outputs are not the same, go through each property
20+ if ( JSON . stringify ( papers [ 0 ] ) === JSON . stringify ( papers [ 1 ] ) &&
21+ JSON . stringify ( papers [ 0 ] ) === JSON . stringify ( papers [ 2 ] ) &&
22+ JSON . stringify ( papers [ 1 ] ) === JSON . stringify ( papers [ 2 ] ) ) {
23+ console . log ( 'hello' )
24+ }
25+ }
26+
827 return (
9- < div className = "flex flex-col" >
10- < div >
11- < HiArrowLeft />
12- { /* TODO: get data of paper */ }
28+ < div className = "flex flex-col gap-2 p-4" >
29+ < div className = "flex flex-row gap-4" >
30+ < Button className = "bg-usask-green" variant = "flat" >
31+ < HiArrowLeft color = "white" />
32+ </ Button >
33+ < span > paper name placeholder </ span >
1334 </ div >
14- < div className = "flex flex-row justify-between" >
15- < div >
16- < Accordion >
35+ < div className = "flex flex-row justify-between gap-3 " >
36+ < div className = "grow basis-1/3" >
37+ < Accordion variant = "light" isCompact selectionMode = "multiple" >
1738 < AccordionItem key = "1" aria-label = "Accordion 1" title = "hellooooooooooooooooooooooooooooooooooooooooooo" >
1839 { defaultContent }
1940 </ AccordionItem >
@@ -25,8 +46,14 @@ export default function EditEntry() {
2546 </ AccordionItem >
2647 </ Accordion >
2748 </ div >
28- < div className = "border-solid border-2 border-slate-900 rounded" >
29- < p > this is some test content for the page</ p >
49+ < div className = "border-solid border-2 border-slate-900 rounded grow" >
50+ < p > Unresolved Conflicts</ p >
51+
52+ { papers . length > 1 ? (
53+ < span >
54+ { unresolvedConflicts . map ( ( conflict ) => conflict ) }
55+ </ span >
56+ ) : ( < span > </ span > ) }
3057 </ div >
3158 </ div >
3259 </ div >
0 commit comments