@@ -2,7 +2,7 @@ import React, { useState } from 'react';
22import { GridRenderCellParams } from '@mui/x-data-grid' ;
33import type { MapRowResult } from '../../components/NERDataGrid' ;
44import type { MouseEvent } from 'react' ;
5- import { Box , IconButton , Checkbox } from '@mui/material' ;
5+ import { Box , IconButton , Checkbox , Tooltip } from '@mui/material' ;
66import LoadingIndicator from '../../components/LoadingIndicator' ;
77import { useEditSponsor , useGetAllSponsors } from '../../hooks/finance.hooks' ;
88import ErrorPage from '../ErrorPage' ;
@@ -19,6 +19,7 @@ import SponsorTasksModal from './FinanceComponents/SponsorTasksModal';
1919import SidePagePopup from './FinanceComponents/SidePagePopup' ;
2020import NERDataGrid from '../../components/NERDataGrid' ;
2121import { useCurrentUser } from '../../hooks/users.hooks' ;
22+ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined' ;
2223
2324const SponsorsTable = ( ) => {
2425 const { data : sponsors , isLoading : sponsorIsLoading , isError : sponsorIsError , error : sponsorError } = useGetAllSponsors ( ) ;
@@ -50,11 +51,13 @@ const SponsorsTable = () => {
5051 } ;
5152
5253 const columns = [
53- { field : 'name' , headerName : 'Sponsor' , flex : 1 } ,
54+ { field : 'name' , headerName : 'Sponsor' , flex : 1 , minWidth : 50 } ,
5455 {
5556 field : 'activeStatus' ,
5657 headerName : 'Active?' ,
57- width : 160 ,
58+ flex : 1 ,
59+ minWidth : 50 ,
60+ maxWidth : 100 ,
5861 renderCell : ( p : GridRenderCellParams < boolean , MapRowResult < Sponsor > > ) => (
5962 < Checkbox
6063 disabled = { ! canEditSponsors }
@@ -69,33 +72,38 @@ const SponsorsTable = () => {
6972 />
7073 )
7174 } ,
72- { field : 'sponsorContact' , headerName : 'Contact' , flex : 1 } ,
75+ { field : 'sponsorContact' , headerName : 'Contact' , flex : 1 , minWidth : 50 } ,
7376 {
7477 field : 'tier' ,
7578 headerName : 'Sponsor Tier' ,
76- width : 140 ,
79+ flex : 1 ,
80+ minWidth : 100 ,
7781 renderCell : ( params : GridRenderCellParams < any , MapRowResult < Sponsor > > ) => (
7882 < SponsorTierPill tier = { ( params . row as MapRowResult < Sponsor > ) . raw ! . tier } />
7983 )
8084 } ,
8185 {
8286 field : 'sponsorValue' ,
8387 headerName : 'Sponsor Value' ,
84- width : 160 ,
88+ flex : 1 ,
89+ minWidth : 50 ,
8590 renderCell : ( p : GridRenderCellParams < number , MapRowResult < Sponsor > > ) => `$${ p . value } `
8691 } ,
8792 {
8893 field : 'joinDate' ,
8994 headerName : 'Sponsor Join Date' ,
90- width : 180 ,
95+ flex : 1 ,
96+ minWidth : 100 ,
9197 renderCell : ( p : GridRenderCellParams < string | null , MapRowResult < Sponsor > > ) =>
9298 datePipe ( new Date ( String ( p . value ?? '' ) ) )
9399 } ,
94- { field : 'discountCode' , headerName : 'Discount' , flex : 1 } ,
100+ { field : 'discountCode' , headerName : 'Discount' , flex : 1 , minWidth : 50 } ,
95101 {
96102 field : 'taxExempt' ,
97103 headerName : 'Tax Exempt?' ,
98- width : 120 ,
104+ flex : 1 ,
105+ minWidth : 50 ,
106+ maxWidth : 100 ,
99107 renderCell : ( p : GridRenderCellParams < boolean , MapRowResult < Sponsor > > ) => {
100108 return (
101109 < Checkbox
@@ -112,10 +120,35 @@ const SponsorsTable = () => {
112120 ) ;
113121 }
114122 } ,
123+ {
124+ field : 'sponsorNotes' ,
125+ headerName : 'Notes' ,
126+ flex : 1 ,
127+ minWidth : 40 ,
128+ maxWidth : 80 ,
129+ sortable : false ,
130+ filterable : false ,
131+ renderCell : ( p : GridRenderCellParams < string | null , MapRowResult < Sponsor > > ) => {
132+ const notes = ( p . row as MapRowResult < Sponsor > ) . raw ?. sponsorNotes ;
133+
134+ if ( ! notes || notes . trim ( ) === '' ) {
135+ return null ;
136+ }
137+
138+ return (
139+ < Tooltip title = { notes } arrow placement = "left" >
140+ < IconButton size = "small" sx = { { p : 0.5 , color : 'white' } } >
141+ < InfoOutlinedIcon fontSize = "small" />
142+ </ IconButton >
143+ </ Tooltip >
144+ ) ;
145+ }
146+ } ,
115147 {
116148 field : 'tasks' ,
117149 headerName : 'Sponsor Tasks' ,
118- width : 180 ,
150+ flex : 1 ,
151+ minWidth : 100 ,
119152 sortable : false ,
120153 filterable : false ,
121154 renderCell : ( params : GridRenderCellParams < any , MapRowResult < Sponsor > > ) => {
@@ -147,7 +180,9 @@ const SponsorsTable = () => {
147180 {
148181 field : 'actions' ,
149182 headerName : 'Delete' ,
150- width : 100 ,
183+ flex : 1 ,
184+ minWidth : 50 ,
185+ maxWidth : 80 ,
151186 sortable : false ,
152187 filterable : false ,
153188 renderCell : ( params : GridRenderCellParams < any , MapRowResult < Sponsor > > ) => {
0 commit comments