Commit 62d7cb6a by Arjun Jhukal

updated the getInitials to get initial of user name if first_name and last name doesnt exist

parent f8202c1e
...@@ -140,45 +140,48 @@ export default function TableHeader({ ...@@ -140,45 +140,48 @@ export default function TableHeader({
)} )}
{/* <Filter /> */} {/* <Filter /> */}
<Button {customRange ? (
startIcon={!downMD && <ArrowDown size={16} />} <>
onClick={() => setShowCustomRangeModal(true)} <Button
sx={{ startIcon={!downMD && <ArrowDown size={16} />}
borderRadius: "8px", onClick={() => setShowCustomRangeModal(true)}
border: "1px solid var(--Gray, #E0E0E3)", sx={{
padding: "8px 16px", borderRadius: "8px",
color: "#0E0E11", border: "1px solid var(--Gray, #E0E0E3)",
maxWidth: "fit-content", padding: "8px 16px",
}} color: "#0E0E11",
> maxWidth: "fit-content",
Filter By Date }}
</Button> >
Filter By Date
<Dialog </Button>
open={showCustomRangeModal}
onClose={() => setShowCustomRangeModal(false)} <Dialog
maxWidth="xs" open={showCustomRangeModal}
fullWidth onClose={() => setShowCustomRangeModal(false)}
PaperProps={{ maxWidth="xs"
sx: { fullWidth
borderRadius: 3, PaperProps={{
backgroundColor: "rgba(0,0,0,0.8)", // ✅ visible background sx: {
boxShadow: 3, // ✅ subtle shadow borderRadius: 3,
padding: 2, backgroundColor: "rgba(0,0,0,0.8)", // ✅ visible background
}, boxShadow: 3, // ✅ subtle shadow
}} padding: 2,
> },
<DialogContent sx={{ p: 0 }}> }}
<DateRangePicker >
startDate={startDate} <DialogContent sx={{ p: 0 }}>
endDate={endDate} <DateRangePicker
onStartDateChange={setStartDate} startDate={startDate}
onEndDateChange={setEndDate} endDate={endDate}
onApply={handleApplyCustomRange} onStartDateChange={setStartDate}
onReset={handleResetCustomRange} onEndDateChange={setEndDate}
/> onApply={handleApplyCustomRange}
</DialogContent> onReset={handleResetCustomRange}
</Dialog> />
</DialogContent>
</Dialog>
</>) : ""}
{/* Download Button */} {/* Download Button */}
{onDownloadCSV && <Button {onDownloadCSV && <Button
......
...@@ -26,7 +26,7 @@ export default function LatestRegisteredPlayer() { ...@@ -26,7 +26,7 @@ export default function LatestRegisteredPlayer() {
header: "Name", header: "Name",
cell: ({ row }) => { cell: ({ row }) => {
const { first_name, last_name, name } = row.original; const { first_name, last_name, name } = row.original;
const initials = getInitials(first_name, last_name); const initials = getInitials(first_name, last_name) || getInitials(row.original.name);
return ( return (
<Box className="flex justify-start items-center gap-2"> <Box className="flex justify-start items-center gap-2">
......
...@@ -89,7 +89,7 @@ export default function PlayerListing() { ...@@ -89,7 +89,7 @@ export default function PlayerListing() {
header: "Name", header: "Name",
cell: ({ row }) => { cell: ({ row }) => {
const { first_name, last_name, name } = row.original; const { first_name, last_name, name } = row.original;
const initials = getInitials(first_name, last_name); const initials = getInitials(first_name, last_name) || getInitials(row.original.name);
return ( return (
<Box className="flex justify-start items-center gap-2"> <Box className="flex justify-start items-center gap-2">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment